Generate Multiple Files with /scriptfile option

I am calling SQLCompare from the commandline, passing in a SQLCompare project file. The project is comparing source control --> server instance.

I'm using the project file as a "release definition" by selecting the objects affected in the release I'm building in SQL Compare and then saving the project file.

Then I use the command line to build the release script /scriptfile option) and diff report (/report option).

Final commandline looks something like this:

"C:\Program Files (x86)\Red Gate\SQL Compare 13\sqlcompare.exe" /project:%%f /scriptfile:"%%~nf\deploy.sql" /report:"%%~nf\changes.html" /reporttype:Html /force


Where I'm running this in a batch loop over all .scp files in the release folder (where the release has componants on multiple databases).

This works well and generates me a folder for each DB with a release script and diff report.

However, we find a single deployment script

1) Unwieldy
2) Hard to read and review
3) Hard to customize.

I know ideally we want to rely on the process - but for where we are right now what I'd REALLY like is, instead of a single script file "deploy.sql" containing the ordered set of changes,

1 script PER OBJECT MODIFIED containing the changes to that object, written in alphanumeric order.... ie:

001_RedGateMetaData.sql
002_Database.Schema.MyTable.sql
....
010_Migration_xxxx_.sql

is there any way to get SQL Compare to produce output like this when using the /scriptfile option - or a different option that might achieve this?

Cheers,

Alexander
Tagged:

Answers

Sign In or Register to comment.