Wednesday, October 15, 2014

Insert Table with Select Statement

2 Method to Insert Table with Select Statement (VALUES no need )

INSERT INTO table2
(column_name(s))
SELECT column_name(s)
FROM table1;


1 as [ColumnName]

*Use this when Primary key is auto generate.

OR

INSERT INTO table2
SELECT * FROM table1;

No comments:

Post a Comment