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
 insert multi records in single query

Author  Topic 

pentahari
Starting Member

26 Posts

Posted - 2008-10-01 : 05:30:32
how to insert multi records in single query

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-10-01 : 05:37:36
insert into table(col1,col2,col3)
select value1, value2, value3
union all
select value1, value2, value3
union all
select value1, value2, value3


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-01 : 05:40:24
insert into table2 (col1,col2,col3)
select value1, value2, value3 from table where value5 = 'a'




E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -