Discussion in 'General Developer Questions' started by mpolaiah, Feb 6, 2009.
How to insert multible records in a table at atime
Perhaps you are looking at BOL and only finding an example like:
INSERT INTO table (col1, col2)
VALUES (val1, val2)
If the records are in Table1, and you want to insert them into Table2, then it's simple:
INSERT INTO Table2 (col1, col2)
SELECT t.colA, t.colB
FROM Table1 t
... perhaps with some filtering criteria in a WHERE clause.
Which version of SQL Server are you using?
sql server 2000
Okay, in that case Adriaan's suggestion or SELECT INTO are the only ways to do this from table to table.
You can use Union All to insert a multiple records
Separate names with a comma.