how to find unique records from 2 diff table in diff database
for example
1st database 1sttable 2nddatabase 2nd table
1st table has 14,15,16,17
2nd table has 13,14,15,16,17,18
so i want only 13 and 18 record
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 20, 2013, 6:25 PM EST
hi,
you can use following query if both database is in same server
select * from database1.dbo.table1 t1
where t1.Id not in(select Id from database2.dbo.table2 t2)
if your databases are not on same server then you must create link server between those database.
for creating link server please refer
http://msdn.microsoft.com/en-us/library/ff772782.aspx
http://www.c-sharpcorner.com/uploadfile/suthish_nair/linked-servers-in-sql-server-2008/
hope this will help you.