Settings and activity
3 results found
-
3 votes
An error occurred while saving the comment -
7 votesEric supported this idea ·
-
7 votes
An error occurred while saving the comment Eric commentedIt seems like you would place a flag on the \sync parameter and toggle the verbiage to default as "Missing" or "Extra" in place of "Added" or "Removed".
Eric supported this idea ·
(I'm just another user) I'm working with the commandline options for SQL Compare to create a batch file across our environment. Maybe you just need direction to this information.
https://documentation.red-gate.com/sc/using-the-command-line/options-used-in-the-command-line
You can have this also if useful for someone.
/*EXAMPLE creates html report for changes which would bring DB345 in sync with the baseline DB123*/
/* /force will allow overwrite of prior file*/
/* /quiet reduces commandline output*/
/*To automate changes, review use of /sync. not included in example */
declare @exeLocation varchar(500) = 'C:\Program Files (x86)\Red Gate\SQL Compare 14\SQLCompare.exe'
declare @Server1 varchar(100) = 'ABC\INSTANCE1' --SOURCE SERVER
declare @Server2 varchar(100) = 'ABC\INSTANCE2' --SECONDARY SERVER
declare @Database1 varchar(100) = 'DB123' --SOURCE DB
declare @Database2 varchar(100) = 'DB345' --SECONDARY DB
declare @ProjectPath varchar(500) ='D:\SQLCompare\SharedProjects\'
declare @ProjectName varchar(100) = 'Prod' --excludes file extension ".scp"
declare @FilterPath varchar(500) = 'D:\SQLCompare\SharedFilters\'
declare @FilterName varchar(100) = 'Only_StoredProc' --excludes file extension ".scpf"
declare @ReportPath varchar(500) = 'D:\SQLCompare\SharedReports\'
declare @ReportName varchar(500) = + REPLACE(@Server2,'\','_') + '_' + @Database2 + '.html'
declare @ReportType varchar(10) = 'html'
declare @additionalParameters varchar(100) =' /force /quiet' /*leading space*/
declare @runStmt varchar(max)
declare @quote char(1) = '"'
select @runStmt =
@quote + @exeLocation + @quote
+ ' /Server1:'+@Server1
+ ' /db1:' + @Database1
+ ' /Server2:'+@Server2
+ ' /db2:' + @database2
+ ' /project:' + @quote + @ProjectPath + @Projectname + '.scp' + @quote
+ ' /filter:' + @quote + @FilterPath + @FilterName + '.scpf' + @quote
+ ' /report:' + @quote + @ReportPath + @ReportName + @quote
+ ' /ReportType:' + @ReportType
+ @additionalParameters
print @runStmt