SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Poor Man's Table Difference


Poor Man's Table Difference

Author
Message
klini
klini
SSC-Enthusiastic
SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)

Group: General Forum Members
Points: 152 Visits: 245
Comments posted to this topic are about the item Poor Man's Table Difference
Roger L Reid
Roger L Reid
Right there with Babe
Right there with Babe (798 reputation)Right there with Babe (798 reputation)Right there with Babe (798 reputation)Right there with Babe (798 reputation)Right there with Babe (798 reputation)Right there with Babe (798 reputation)Right there with Babe (798 reputation)Right there with Babe (798 reputation)

Group: General Forum Members
Points: 798 Visits: 166
Thanks for posting. It's a difficult problem at times; I was hoping I could borrow your approach for my own situation. But doing the True General Proc for this kind of thing would have to be a major project in its own, I can tell you.

My own situation is copying from ASE to SS; there are so many issues to be found - even things like "user copied a string with smart quotes from MS Word into a varchar field"; which is a character set incompatability no matter how well you try to match them.

My own choice to generate line-based text files and use Unix's sort/diff to get the cross platform differences had its problems too.

On pure SQL Server, however, I'm usually just using "except" with a little logic. Running on 64-bit servers, it's amazing how much can be done how quickly to find differences between results (not just "base tables", any result).

You gotta do what works. Too bad Fabian Pascal's predicted world of DRDBMS never came to pass.

Roger L Reid
jddddd2
jddddd2
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 44
If you're going to sync the DB's then eventually you need to find out what column/row is different. This solution doesn't address specific column and row to update in order to sync them which opens up a big can or worms.
klini
klini
SSC-Enthusiastic
SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)SSC-Enthusiastic (152 reputation)

Group: General Forum Members
Points: 152 Visits: 245
jddddd2,

Just happens for my case that if the row is different, the newest row is plastered onto the other copy. But you're right...if the requirements need to look at columns, something more would be needed.
Iwas Bornready
Iwas Bornready
One Orange Chip
One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)

Group: General Forum Members
Points: 29532 Visits: 885
Thanks for the script.
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