Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Union all

Author  Topic 

ashtu
Starting Member

10 Posts

Posted - 2010-02-03 : 09:54:17
How can i insert multiple records into table in sigle statement use of union all SqlServer2008.?
plz Ealborate with example.

Ashish

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-02-03 : 10:02:15
[code]INSERT yourTable (a, b, c)
SELECT 1, 2, 3 UNION ALL
SELECT 4, 5, 6 UNION ALL
SELECT 7, 8, 9[/code]
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-03 : 11:09:38
if sql 2008 you can just use

INSERT yourTable (a, b, c)
VALUES (1,2,3),(4,5,6),(7,8,9)
Go to Top of Page
   

- Advertisement -