Data Comparison | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Data Comparison


I have an Employee table with 3000 records and an Excel file having the modified data of those emplyoees. Some of the data of Excel may be same as that of table data but some may differ. EmpId is the unique field. Other than this field, other fields of Excel may have modified data.I need to compare the data from SQL Server table with Excel Data.
I decided to write a VB Program having two recordsets,one for SQL Server and other for Excel and compare each field’s value. If the modified value is found then update that to table. Is there any way to compare in SQL Server itself?
Madhivanan Failing to plan is Planning to fail
I have a solution for this. But not sure whether u like it
1.From DTS import excel data into the SQL Server Table
2. By using third party tool like SQL Compare , u can generates scripts to update table
quote:Originally posted by Madhivanan
I have an Employee table with 3000 records and an Excel file having the modified data of those emplyoees. Some of the data of Excel may be same as that of table data but some may differ. EmpId is the unique field. Other than this field, other fields of Excel may have modified data.I need to compare the data from SQL Server table with Excel Data.
I decided to write a VB Program having two recordsets,one for SQL Server and other for Excel and compare each field’s value. If the modified value is found then update that to table. Is there any way to compare in SQL Server itself?
Madhivanan Failing to plan is Planning to fail

Though when you import you should make sure you import to a separate database and give the table the same name as the final table and make sure you create your unique index on your primary keys on both tables otherwise SQL Data compare doesn’t work. Dave. [email protected]
www.matiogi.com
Yes i miss that point,thankx dave
quote:Originally posted by dhilditch Though when you import you should make sure you import to a separate database and give the table the same name as the final table and make sure you create your unique index on your primary keys on both tables otherwise SQL Data compare doesn’t work. Dave. [email protected]
www.matiogi.com

]]>