insert into DestinationTable
select c.* from Sourcetable c left join DestinationTable d
on d.ForeignKey=c.PrimaryKey
where d.ForeignKey is null
This will insert all the records into DestinationTable that exist in the Sourcetable but not in DestinationTable
you can limit the records by using TOP
âI sense many useless updates in you... Useless updates lead to fragmentation... Fragmentation leads to downtime...Downtime leads to suffering..Fragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" --
http://sqlservercode.blogspot.com/