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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to write if-exists query

Author  Topic 

goodsolution
Starting Member

38 Posts

Posted - 2009-07-27 : 09:40:44
Hi all,
I have 2 tables, I need to grab all data from table1 and and i need to lookup with table2 and if there are any unmatched rows then i want to insert into table1. I could able to do this using SSIS package, but i want to write T-sql code for it, can anyone help me out in this?

I am trying to write if exists statement

-Thanks

waterduck
Aged Yak Warrior

982 Posts

Posted - 2009-07-27 : 09:49:16
http://weblogs.sqlteam.com/peterl/archive/2009/06/12/Timings-of-different-techniques-for-finding-missing-records.aspx
by peso saint...


Hope can help...but advise to wait pros with confirmation...
Go to Top of Page
   

- Advertisement -