October 31, 2007 at 4:05 am
Hi everybody,
I compare two database in order to upgrad the oldest according to the newer,
the both database need to store the same data ,henc, for the most part they consist same table and each table consist same column.
To compare table or column,I'm using the table_name or column_name
Though ,there is parallel column that have different names :crazy:
Is anyone have an idea how can I figure out that two columns from two database serves for the same purpose.
I know that I can compare there type or length, but its not satisfied ,I prefered somthing more injective
Thanks
Rachamim
October 31, 2007 at 4:14 am
There are many third party tools available in the market, such as SQL Compare from RedGate, SQLDiff from ApexSQL with 30 day free trial editions...
--Ramesh
October 31, 2007 at 4:19 am
One possible way of doing this is to have a user defined function for "distance". In case of two numeric columns a difference/ratio (careful with nulls). And then have a query that calculates this distance for the possible column combinations.
E.g. TableInDB1 (a int, b int, c int), TableInDB2 (a int, d int, e int) (based on the type similarities and the unmatched columns you can have a query that gets max distance(TableInDB1.b, TableInDB2.d), max distance(TableInDB1.c, TableInDB2.d), max distance(TableInDB1.c, TableInDB2.d), max distance(TableInDB1.c, TableInDB2.e)
If any of these distance maximums/minimums are in a threshold range, then the column pairs are possibly parallel columns. This is a very simple approach (there are more complex ones), and it is resource intensive as well. However, it can be automated, so it saves you sitting in front of the computer 🙂
Regards,
Andras
October 31, 2007 at 4:23 am
well I know
But in some reasons I need to do it myself.:crying:
Rachamim
October 31, 2007 at 4:25 am
my last post intended to Ramesh
the traffic here is very fast
October 31, 2007 at 4:44 am
Tanks Andres
I going to try it
Well as you said its "resource intensive as well" and I'll need to check out if the program can suffer the overhead of such solution
Rachamim
October 31, 2007 at 6:35 am
but which parameter ,except column_type and length ,that usually identical, I can use to calculate distance?
Rachamim
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply