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.
Author |
Topic |
Exir
Posting Yak Master
151 Posts |
Posted - 2010-01-27 : 05:35:58
|
HiHow can i insert rows from table1 to table2 which exists in table1 and not exists in table2 ? |
|
Kristen
Test
22859 Posts |
Posted - 2010-01-27 : 05:55:15
|
[code]INSERT INTO Table2(Col1, Col2, ...)SELECT Col1, Col2, ...FROM Table1 AS T1WHERE NOT EXISTS (SELECT * FROM Table2 AS T2 WHERE T2.SomeID = T1.SomeID)[/code] |
|
|
|
|
|