Can you use the sql compare command line to generate a change script?
Devware
Posts: 2 New member
in SQL Compare
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.
Tagged:
Best Answers
-
Kendra_Little Posts: 139 Gold 3Hi @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 -
DanC Posts: 644 Gold 5Hi @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!
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?
Answers