"select * Into Table" Will It Work For Inserting Data Into Existing Table
Solution 1:
You should try
INSERTINTO ExistingTable (Columns,..)
SELECT Columns,...
FROM OtherTable
Have a look at INSERT
and SQL SERVER – Insert Data From One Table to Another Table – INSERT INTO SELECT – SELECT INTO TABLE
Solution 2:
No, you cannot use SELECT INTO to insert data into an existing table.
The documentation makes this very clear:
SELECT…INTO creates a new table in the default filegroup and inserts the resulting rows from the query into it.
You generally want to avoid using SELECT INTO in production because it gives you very little control over how the table is created, and can lead to all sorts of nasty locking and other performance problems. You should create schemas explicitly and use INSERT - even for temporary tables.
Solution 3:
Update from CTE? http://www.sqlservercentral.com/Forums/Topic629743-338-1.aspx
Solution 4:
@Ryan Chase Can you do this by selecting all columns using *? Yes!
INSERT INTO yourtable2
SELECT * FROM yourtable1
Post a Comment for ""select * Into Table" Will It Work For Inserting Data Into Existing Table"