INSERT DestTable
SELECT <cols>
FROM SourceTable s
WHERE NOT EXISTS (SELECT * FROM DestTable d
WHERE d.uniquecol(s) = s.uniquecol(s))
-----Original Message-----
From: vijay
[mailto:mssqldba-ezmlmshield-x57380787.[Email address protected]
Sent: Thursday, October 27, 2005 5:48 PM
To: LazyDBA Discussion
Subject: Duplicate checking
Dear All,
Can anyone help me how to check duplicate rows if I am inserting from one
table to another table.
Thanks & Regards
Vijay N Sharma
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
MS Sql Server LazyDBA home page