SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On



Using SQl data compare assigning custom comparison keys Expand / Collapse
Author
Message
Posted Sunday, January 31, 2010 1:38 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 01, 2010 11:49 PM
Points: 14, Visits: 43
Hi I am using SQL data Compare to on a database one is dated 21 and the other is 23 jan.

I am not able to compare a few tables so it specifies that I explicitly give a custome comparison key
a couple of my tables dont have primary keys or any otehr unique keys which column should i select in this case.

Post #856768
Posted Sunday, January 31, 2010 1:45 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 3:43 PM
Points: 299, Visits: 386
You should select a column or a set of columns that you can use to compare the data in the two tables. Usually this column or a set of columns would act like a primary key.

I have only used SQL Data Compare once. So Hopefully, someone with more experience with the tool will be help you out. But in the meanwhile try the above.

And the RedGate support site talks about comparison key and what are good candidates. Check it out if you havent already.
SQL Data Compare - Selecting tables and views



Post #856772
Posted Sunday, January 31, 2010 1:51 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 01, 2010 11:49 PM
Points: 14, Visits: 43
thanks for the prompt reply

Well I am just selecting one column randomly as the comparison key but there is a row in the UI of SQL Data Compare that states Columns in Comparison which by default takes all the columns.

but my concern here is that in few tables i have null values in the coumns that I am selecting and in some the data in those columns repeat in different records.

A bit puzzeled as to how SQL Data Compare compares the data in the tables does it scan through each data in revry cell ie does it compare every column of each record or does it just just pick up each record with the comparison key???
Post #856775
Posted Sunday, January 31, 2010 11:25 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 3:43 PM
Points: 299, Visits: 386
Please choose you comparison key carefully.

mohammed.arsalan (1/31/2010)

A bit puzzeled as to how SQL Data Compare compares the data in the tables does it scan through each data in revry cell ie does it compare every column of each record or does it just just pick up each record with the comparison key???


Logically, I would assume it would compare all the column values from the two tables based on the Comparison key column(s).

For Modified Rows
It will be like a join on the comparison key and find records where corresponding either match or don't.
For New Rows
It will be where the rows don't exists in the table for the comparison key. Think of like a Sub query where Comparison NOT IN.

Physically, the implementation would be using some complex algorithms for obviously better performance.

Does that answer your question.



Post #856831
Posted Sunday, January 31, 2010 10:50 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 01, 2010 11:49 PM
Points: 14, Visits: 43
I dont know exactly but it compares table records even if I select a row with NULL values so I can say that its not only using the perticular value for the join

Logically it should be like this but if possible i need some insight from any one who has used SQL Data Compare and is sure about the internal working
At the moment i need to make some decisions on my dta integrety
Post #856938
Posted Tuesday, February 02, 2010 12:37 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 10:51 AM
Points: 5,882, Visits: 2,380
mohammed.arsalan (1/31/2010)
I dont know exactly but it compares table records even if I select a row with NULL values so I can say that its not only using the perticular value for the join

Logically it should be like this but if possible i need some insight from any one who has used SQL Data Compare and is sure about the internal working
At the moment i need to make some decisions on my dta integrety



You MUST select a column that ensures accurate comparison. The appropriate column should be a key column. If no key column exists, you must select a combination of columns.

The only time you can get away with not choosing an appropriate column is if one table is empty and you are populating it. A good set of columns to use would potentially include a date column and a candidate key.




Jason
I have given a name to my pain...

SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #857756
« Prev Topic | Next Topic »


Permissions Expand / Collapse