In SQL Server, these do the same thing essentially. What are the the pros/cons of doing it each way?
select * into table
vs.
insert into table select *
I'm looking for reasons such as performance, best practice, maintainability, etc.
In SQL Server, these do the same thing essentially. What are the the pros/cons of doing it each way?
select * into table
vs.
insert into table select *
I'm looking for reasons such as performance, best practice, maintainability, etc.
SELECT ... INTO mytable
creates a new table. It fails if mytable
already exists.
INSERT ... INTO mytable
inserts into an existing table. It fails if mytable
does not exist.
SELECT * INTO TABLE
this inserts data into a new table
INSERT INTO TABLE SELECT *
copies the data from an existing table to another existing table