Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Table comparision

Author  Topic 

tkothari
Starting Member

3 Posts

Posted - 2012-11-01 : 14:50:51
I have 2 tables each table has 45 million rows, I want to make sure the data are same in both the table, I did the row count and it's coming same for both the table, is there any other way i can make sure data are also same


Thanks
Tina

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-11-01 : 15:15:51
I suspect the usual approaches such as EXCEPT, UNION ALL (http://weblogs.sqlteam.com/jeffs/archive/2004/11/10/2737.aspx) etc. may be a non-started for you because of the amount of data involved.

I have no direct experience with the tablediff utility, but you might want to give that a try: http://msdn.microsoft.com/en-us/library/ms162843(v=sql.105).aspx
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2012-11-02 : 18:36:52
RedGate does have a SQL Data Compare utility but it won't be fast on tables this size. Alternately, you could use the CHECKSUM function to compare the table values. Another approach, if you only want to assure that the second table is identical to the first, would be to truncate the second table and copy the first table into the second.

=================================================
We are far more concerned about the desecration of the flag than we are about the desecration of our land. -Wendell Berry
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2012-11-02 : 18:50:47
Use tablediff

-Chad
Go to Top of Page
   

- Advertisement -