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 |
|
Limuh
Yak Posting Veteran
94 Posts |
Posted - 2008-02-13 : 03:05:37
|
Im comparing two tables #T1 and #T2 and i want to insert data to other table #O1 if the data in table #T1 NOT IN table #T2 it loads to table #O1. I was advised not to use NOT IN Statement.If i query using NOT IN it returns multiple same datas in rows. Please Help.. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-02-13 : 03:23:58
|
| INSERT #O1SELECT fieldsFROM #T1 t1LEFT OUTER JOIN #T2 t2ON t2.linkfield=t1.linkfieldWHERE t2.linkfield IS NULL |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-13 : 03:51:21
|
| or use not existsMadhivananFailing to plan is Planning to fail |
 |
|
|
Limuh
Yak Posting Veteran
94 Posts |
Posted - 2008-02-19 : 03:04:17
|
| thanks |
 |
|
|
|
|
|