Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Automate script for comparing two tables


Automate script for comparing two tables

Author
Message
sangeethasriram18
sangeethasriram18
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 6
Hi,

Any idea on how to build a sql script for comparing the data between two tables in a database with similar attributes and non similar attributes?
Andras Belokosztolszki
Andras Belokosztolszki
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1385 Visits: 1585
sangeethasriram18 (3/4/2008)
Hi,

Any idea on how to build a sql script for comparing the data between two tables in a database with similar attributes and non similar attributes?


Could you explain it in a bit more details? In some cases a full outer join (and maybe some extra columns that are calculated based on whether two corresponding columns that are not part of the join are the same or not).

Regards,
Andras



Andras Belokosztolszki, MCPD, PhD
GoldenGate Software
Andras Belokosztolszki
Andras Belokosztolszki
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1385 Visits: 1585
sangeethasriram18 (3/4/2008)
Hi,

Any idea on how to build a sql script for comparing the data between two tables in a database with similar attributes and non similar attributes?


Another note Smile There are third party tools for data comparison in your tables in case you need to do this frequently, need a nice UI, have the data in different databases/different servers, need to do full or partial migration/merge

Regards,
Andras



Andras Belokosztolszki, MCPD, PhD
GoldenGate Software
sec_173
sec_173
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 42
Wondered if this script might help....
http://www.sqlservercentral.com/scripts/Administration/61813/

Otherwise - recommend the redgate tools :-)

Regards
Suze.
sangeethasriram18
sangeethasriram18
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 6
Since the number of columns are high,I cannot use the joins in the script to declare each and every column at all times.

Please let me know is there any other possibilities for different data structures to compare with huge amount of columns.
I am not suggested to use third party tools. So plz provide me in the form of SQL script if possible.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search