|
|
| |

How can I compare the data in two tables with identical structure?
Answer:
1. Compare the row counts in these tables by using the COUNT(*) function:
SELECT COUNT(*) FROM tb1
SELECT COUNT(*) FROM tb2
2. If the row counts in the tables is identical, you can download the data
from these tables into files on the disk by using the bcp utility and compare
the size of these files.
To get more information about what rows are differ, you can compare these files
by using the comp.exe utility (C:\WINNT\system32 - path by default for Windows NT).
3. You can use red-gate SQL compare to do this. It can compare tables, constraints,
rules, stored procedures and creates a script for applying the changes from one
database to another.
You can download the 14 days trial version at here:
http://www.red-gate.com
See also this link:
How can I compare two databases?
|
|
|