Populating tables without comparing

crutledgecrutledge Posts: 10
edited October 14, 2010 12:07PM in SQL Data Compare Previous Versions
Hi,

I'm sure this has been asked before but I can't seem to find it. I'm often in a situation where I have a local copy of a database, and I want to generate a script that will populate another copy of the database with the data I have locally. But I don't want to have to restore a dummy database and compare the tables in the two databases to get the script.

I'd like to be able to point to the table and say "Give me a script that generates the data in this table." How would I do that with SQL Data Compare?

Thanks,

C

Comments

  • This isn't really something that Data Compare is designed to do (as you've discovered).

    You might want to check out SQL Packager which can create scripts of your database (schema / data / both)
    Systems Software Engineer

    Redgate Software

  • Or you can use 'Generate Scripts' in SSMS 2008, making sure that you set the "Script Data" setting to be 'true' in the Script Options wizard pane.

    David Atkinson
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
  • Thanks folks. I have been using SMS 2008's generate scripts for this. It's a surprisingly well-hidden and poorly documented feature.

    I'm surprised it's not requested more often. I need to do this kind of thing all the time, although I may do things in an unusual way.

    For the record, I would love to have something that let me select rows from a result set in SMS and automatically generate an insert script for them. Quest Software's Toad for SQL Server almost does this, but their syntax only seems to work with SQL 2010. And since I'm using SQL Prompt I'm much happier in SMS than their tool.

    BTW, kudos on your tools. They make my life better every single day (except maybe weekends).
  • Building INSERTs from a result set is something that has been asked for before in the context of SQL Prompt, and is definitely a candidate for a future release.

    I don't know why the Generate Scripts feature is so hidden. It takes me a while to find every time I need it. It's a little too hidden to be practical for a repeat use case.

    Thanks for the feedback,

    David Atkinson
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
Sign In or Register to comment.