Using the sync command

To run the SQL CI sync step, use this syntax:

sqlCI.exe Sync /databaseName=<value1> /package=<value2> /databaseServer=<value3> 


sqlCI.exe Sync /databaseName=WidgetShop /package=WidgetShop\Database\Output\WidgetShop.1.0.nupkg /databaseServer=SQLServer2012

Here are details of all the sync command switches:


The target database to update with the changes in source control.



This must be an existing database on the server; the sync command won't create the database for you.



The path to the package that was created in the build step.




The target database server name.



/databaseUserName (optional)

The username for SQL authentication.



/databasePassword (optional)

The password for SQL authentication.



/additionalCompareArgs (optional)

Specifies additional command line switches to pass through to SQL Compare.

For example, to abort an operation when there are changes that might result in data loss, pass through the /AbortOnWarnings switch like this:



The switch values should always be surrounded by double quotes.

SQL CI already uses SQL Compare's /Options switch with its own set of default values. To include additional options, use the following syntax:



The option values are not case sensitive.

You can also use aliases if you prefer shorthand versions of the options. For details of the alias for each option, see Options used in the command line.



To exclude options, prefix the option with a minus sign. For example:



The default options (with aliases in brackets) used for data comparison are:

  • DecryptPost2KEncryptedObjects (dp2k)
  • IgnoreFillFactor (if)
  • IgnoreWhiteSpace (iw)
  • IncludeDependencies (incd)
  • IgnoreFileGroups (ifg)
  • IgnoreUserProperties (iup)
  • IgnoreWithElementOrder (iweo)
  • IgnoreDatabaseAndServerName (idsn)
  • IgnoretSQLt (itst)
  • UseCompatibilityLevel (ucl)

If the target database you're syncing to contains tSQLt tests, you must exclude the IgnoretSQLt option.

You can include some options and exclude others. For example:



If the switch value contains double quotes, you need to escape them with a backslash. For example, if the switch value is /TIL:"READ COMMITTED", use the following syntax:


/additionalCompareArgs="/TIL:\"READ COMMITTED\""

If you're running sqlCI.exe in PowerShell, you must also insert the backtick character (ASCII 96) to escape each double quote. For example:

/additionalCompareArgs="/TIL:\`"READ COMMITTED\`""

For more information, see Windows PowerShell: about_Escape_Characters (TechNet article).

If you don't insert the correct escape characters, the switch value will be invalid.

For more information about SQL Compare command line options and switches, see Using the command line (SQL Compare Documentation).

/licenseSerialKey (optional)

To activate the DLM Automation license on the machine the build agent is running on, enter the serial number.



For information on finding your DLM Automation serial number, see Licensing. If you don't enter a serial number, a 28 day free trial of the DLM Automation will start automatically.

If you have multiple serial numbers, separate them using commas without spaces.



Didn't find what you were looking for?