Generate merge script for all primary key tables in a database

  • Comments posted to this topic are about the item Generate merge script for all primary key tables in a database

  • 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,

  • 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 ?

  • 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.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply