I'm trying to automate the building of change scripts from one database version to another. I have 2 databases that I'm comparing using the command line and /sync, but that actually modifies the target database. Instead, I want the final sql change script to be generated so it can be ran at a later time against a database I don't have access to. I can do this from the SQL Compare user interface, but would like to automate the process.
Comments
3 comments
-
Hi Devware ,
Yes, you can output SQL Compare results to a script file when using the command line.
Check out the ScriptFile command line switch, I believe that is what you are looking for.
Hope this helps,
Kendra -
Hi @Devware
In order to generate a change script to be applied at a later time you can use the following command line switch /ScriptFile:<file path>
For example, the script may look like the example below:sqlcompare /db1:WidgetStaging /db2:WidgetProduction /scriptFile:"C:\Scripts Folder\WidgetSyncScript.sql"
https://documentation.red-gate.com/sc/using-the-command-line/switches-used-in-the-command-line#Switchesusedinthecommandline-/ScriptFile:<filepath>
However, in order to automate this process, you would require a full toolbelt license which includes SQL Change Automation.
Hope this helps!
-
Perfect, thanks for your help!
Add comment
Please sign in to leave a comment.