|
Execute the following Microsoft SQL Server T-SQL
script in Query Editor to find the delta (difference) set between two tables. The EXCEPT operator method can be used in an SSIS package for synchronizing two tables:
use tempdb
go
select distinct Title, FirstName, LastName, EmailAddress
into dbo.Contact
from AdventureWorks.Person.Contact
go
select Title, FirstName, LastName, EmailAddress
into dbo.ContactCurrent
from dbo.Contact
go
delete TOP (100) from dbo.Contact
go
-- Empty set
select c1.*
from dbo.Contact c1
EXCEPT
select c1.*
from dbo.ContactCurrent c1
go
-- Delta set
select c2.*
from dbo.ContactCurrent c2
EXCEPT
select c1.*
from dbo.Contact c1
go
|