Creating a single large deployment script via commandline..

mihirdmihird Posts: 3
edited February 20, 2014 11:25AM in SQL Compare Previous Versions
Hello guys!

Newbie here, so pardon me, if I am asking something very simple, but I am just starting to get familiar with SQL Compare.

I went down the path trying to figure out, how to export a database to a single SQL schema file. By setting up a compare between the db to be exported and a blank instance, in the Deployment Wizard, I was able to pick "Create a Deployment Script" and noticed that it exports the entire db out in a single schema file.

Great! now, I want to do this on the command line...

I read the command line documentation and the /MakeScripts switch will do something similar, but it exports the db as a set of script files/folders instead of creating one single deplyment script.

Can someone help me figuring out how to make SQLCompare create this single deployment script for the db from the command line?

Thanks for your help!

Mihir

Comments

  • Eddie DEddie D Posts: 1,666 Rose Gold 5
    Thank you for your forum post.

    I suspect that you have chosen the incorrect option. The "/MakeScripts" creates a scripts folder which is the equilvant to the option in the GUI ->File Menu ->Create Scripts Folder.

    The switch you need to use to mimic the Deployment Wizard behaviour of creating the deployment script is "/ScriptFile" as per this simple example:
    sqlcompare /db1:WidgetStaging /db2:WidgetProduction /scriptFile:"C:\Scripts Folder\WidgetSyncScript.sql" /force
    

    Further reading on the available switches can be found HERE.

    Many Thanks
    Eddie
    Eddie Davis
    Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
  • Yep,

    That worked like a charm! Thanks for the help and the referral on the command line switches. Lots of learning to do for a newbie!

    So far, very impressed with SQL Compare.
    Mihir.
Sign In or Register to comment.