Creating a single large deployment script via commandline..

Forum for users of SQL Compare schema synchronization utility

Creating a single large deployment script via commandline..

Postby mihird » Thu Feb 13, 2014 9:54 pm

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!

Posts: 2
Joined: Thu Feb 13, 2014 7:53 pm

Postby eddie davis » Mon Feb 17, 2014 3:29 pm

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:
Code: Select all
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 Davis
Technical Support Engineer
Red Gate Software Ltd
eddie davis
Posts: 1145
Joined: Wed Jun 14, 2006 2:47 pm
Location: Red Gate Software

Thanks you very much for the help!

Postby mihird » Thu Feb 20, 2014 4:25 pm


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.
Posts: 2
Joined: Thu Feb 13, 2014 7:53 pm

Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests