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


Generate merge script for all primary key tables in a database


Generate merge script for all primary key tables in a database

Author
Message
michael.roy.taylor
michael.roy.taylor
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 28
Comments posted to this topic are about the item Generate merge script for all primary key tables in a database
michael.roy.taylor
michael.roy.taylor
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 28
Ladies and Gents, I'm posting a bug fix to this code shortly. Seems to be an issue with the 'comma' placement inside the 'update' block of the code. Thanks,
SQL Guy 1
SQL Guy  1
Right there with Babe
Right there with Babe (730 reputation)Right there with Babe (730 reputation)Right there with Babe (730 reputation)Right there with Babe (730 reputation)Right there with Babe (730 reputation)Right there with Babe (730 reputation)Right there with Babe (730 reputation)Right there with Babe (730 reputation)

Group: General Forum Members
Points: 730 Visits: 2463
Code is very large. In the result set, column list is tabbed to the right some 700 character positions. After running for a bout 2 min, it returned 20k+ rows even though I have only 450 tables. And what if I want to merge just few tables? It is hard to debug resulted code or eliminate some tables from there. Wouldn't it be easier to merge it with SSIS ?
michael.roy.taylor
michael.roy.taylor
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 28
Understandably, the code was originally intended for generating stored procedure code (which are your stored procs that would merge your tables) for 'all common' tables within a given pair of databases (source and destination). Specifying certain tables would require additional input parameters. The biggest reason why I don't use ssis for this, is because metadata within the ssis package can habitually fall out of sync and then you get errors. I try to keep as much of my database automation within the sql world as possible and as little against metadata driven ssis packages (which I've found to be tempermental on a windows 2003 server 64 bit environment with 2008 r2 sql server). I haven't gained enough confidence in ssis yet to use it as a replacement for something I could do writing dynamic sql to do. I guess it's a matter of personal taste.
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