Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding unmatched TSQL 1

Status
Not open for further replies.
Joined
Jun 29, 2001
Messages
195
Location
US
I need to find records in one table where they don't exists in the primary table. I have deletes and changes based on SSN but not all records match in the update files to primary table so I need to extract those and make them adds.

TIA Ashley L Rickards
SQL DBA
 
select * from table1
where not exists
(select * from table2 where table1.key = table2.key)

replace tablle and key with the appropriate table and field names.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top