|
|
|
Grasshopper
      
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.
|
|
|
|
|
SSC 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
|
|
|
|
|
Grasshopper
      
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???
|
|
|
|
|
SSC 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.
|
|
|
|
|
Grasshopper
      
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
|
|
|
|
|
SSCertifiable
       
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
|
|
|
|