Executing multiple INSERT in a single query
Posted by Em on 22 September, 2008
No comments yet
This item was filled under [ SQL Server ]
In SQL Server 2000, you can insert multiple records by using a single INSERT statement. It helps to boost performance a little and the task gets done in a single query.
Sample code:
INSERT INTO MyTable (Col1, Col2) SELECT 'First', 1 UNION ALL SELECT 'Second', 2 UNION ALL SELECT 'Third', 3 UNION ALL SELECT 'Fourth', 4 UNION ALL SELECT 'Fifth', 5 GO
Popularity: 209 views