Data Validation

Hi All,

I need to check/validate customer data in two DB (prod & restored copy). Below are the fields i need to compare from Policyholder table in both DB's and i need to extract the data which are not identical. Table has more than 5m records. What is the efficient way to perform this task? Any reply will be greatly appreciated.

Thanks

Reagrds,
SG

,PolicyHolder.PolicyHolderId
,policyholder.Title
,policyholder.Firstname
,policyholder.LastName
,PolicyHolder.EmailAddress
,PolicyHolder.AddressLineOne
,PolicyHolder.AddressLineTwo
,PolicyHolder.AddressLineThree
,PolicyHolder.TownCity
,PolicyHolder.CountyState
,policyholder.PostcodeZip
,PolicyHolder.Country
,Policyholder.PhoneDaytime
,policyholder.PhoneEvening
PostcodeZip

You can use NOT EXISTS, EXCEPT etc. to compare two tables. With 5 million rows, it is probably going to be slow. You could perhaps evaluate the resource requirements by looking at only a small range of primary key values.

Thanks James.

I found an interesting tools to compare million records in few minutes. I just want to share it here, in case it may help some one in feature.

http://blog.sqlauthority.com/2013/06/24/sql-server-an-efficiency-tool-to-compare-and-synchronize-sql-server-databases/

Regards,
SG