easiest way to update table contents from 1 environment to another

  • I'm developing an app locally and I'm making a lot of changes to a database table. I need to move all the changes to the staging database as easily as possible.

    The table on staging will have fk references to another table so I'm not going to be able to drop it and replace it with my latest local table.

    Is there an option in SSMS or a 3rd party plugin (or maybe even a custom stored procedure) that will auto-generate this type of update script for me? Basically, for each row in a given table generate a script like this?:

    update mytable set

    col1 = col1val,

    col2 = col2val,

    col3 = col3val

    Then I could execute this script on staging to update the staging table with all of the latest data from my local table included in the script?

  • have a look at the data compare tool from Redgate, this will be able to easily generate the change scripts for you... though it does cost but in my opinion it is well worth it.

  • sqlauthority has a good example

    http://blog.sqlauthority.com/2008/04/18/sql-server-generate-foreign-key-scripts-for-database/

    The first line of code starts with coffee. The last line ends with alcohol.

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

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