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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Row Comparison

Author  Topic 

peddi_praveen
Starting Member

48 Posts

Posted - 2003-09-10 : 09:51:33
Hi Friends,
I have got a situation where i have to compare the data for all the fields for given record in one table with data from record in another table.
Eg:
data_to_b_compared table , actual_data tables have the same structure
and i can join both the tables on common KEY.
For a given record for KEYID = 1 from data_to_b_compared table , i have to compare data for all the fields ffor the Record with KEY ID = 1 from actual_table.
tables have same structure and 50 above columns, including text fields.
tables contain huge amount of data.

Plz suggest best possible solutions.

Tx n regs,
Praveen kumar


mr_mist
Grunnio

1870 Posts

Posted - 2003-09-10 : 10:07:31
How much data? Are they supposed to be the same? Have you considered just backing up the one and restoring it over the over?

-------
Moo. :)
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-09-10 : 12:59:28
I always thought Jeff's solution using Union is clever...


http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=21912&SearchTerms=compare,data,union

Brett

8-)

SELECT @@POST=NewId()

That's correct! It's an AlphaNumeric!
Go to Top of Page

peddi_praveen
Starting Member

48 Posts

Posted - 2003-09-11 : 00:18:12
Hi Mist,
Its not backup n restore issue.
Here are more details:
Source data formaT : XML , i store this in data_to_b_compared table.
Then , i have to compare this data with actual_data table.
Data_to_be_compared , actual_Data need not be the Same. but,

if the data in Data_to_be_compared for given KEYID differs from actual_data for given KEYID,then, i have to update the actual_data. While Comparison, i Have to compare more than 50 fields and some fields are text fields.Data in both tables is huge and comparison takes place for all the data in data_to_b_compared table.

No Cursors plz....

Advice Best Possible solutions....

Tx n Regs,
Praveen Kumar
Go to Top of Page

dsdeming

479 Posts

Posted - 2003-09-11 : 08:49:21
As long as you don't have to compare text, ntext, image, or cursor datatypes, try using CHECKSUM(). It's made for building hash indices, but it does exactly the sort of thing you're trying to do.

Dennis
Go to Top of Page

peddi_praveen
Starting Member

48 Posts

Posted - 2003-09-11 : 10:12:03
hi deming,
exactly there u are, tx. but , in my case, we have few text fields.
i had gone thru checksum() and there exactly i struck up.

your help is very much appreciated.
Go to Top of Page
   

- Advertisement -