Synchronizing to a single script file

MartinHMartinH Posts: 82 Bronze 2
edited November 6, 2007 2:17AM in SQL Compare Previous Versions

Can you tell me if it is possible to use SQL Compare Pro to synchronize to a single sql script file? It would be similar to creating a snapshot file, but in sql format.

We usually use a single script file to create a database structure (not data) when installing our software. Currently we generate this with MS SQL Server Managment Studio by scripting the whole database, but it is quite slow and I would prefer to use SQL Compare to update this file when we make changes.



  • The way you make a single large script file which can be run to create a database's structure is as follows:

    1) Make an empty live database, with the same filegroups as the database you're trying to script

    2) Turn on the option 'Do not use transactions in synchronization scripts', which will make the output much cleaner-looking.

    3) Start to synchronize from the database you're trying to script to the empty database, but instead of going all the way through the wizard, go for 'view script' when it's offered, and then save the script. (Alternatively you can just run through the wizard and launch the script in SSMS or QA, then save it from there.)

    If you want to be able to run the single script file directly, you have to repeat this process every time you want a new revision of the script file. SQL Compare Pro's script support is designed to be used to deploy script folders into live databases through using SQL Compare to do the deployment, rather than to make script files which can then be run independantly.
    Software Developer
    Redgate Software
  • MartinHMartinH Posts: 82 Bronze 2

    Thank you for the detailed answer. Yes, that does meet my needs. Simple when you think about it!

    The other day I took the SQL Compare 7 survey, maybe you could add this to the list of ideas for the new version.

    It would be great to be able to synchronize a database to/from a single script file as is done with the snapshot.

    Thanks again,
Sign In or Register to comment.