SQL Automation Pack

Using the SqlCI.exe command line in SQL Automation Pack v1.0.4.2 and earlier

This page applies to SQL Automation Pack v1.0.4.2 and earlier. If you're using a later version, see Using the SqlCI.exe command line in v1.1 and later.

This page lists all the options you can use with the sqlCI.exe command line.

You specify options as follows:

sqlCI.exe --option1=<value> --option2=<value>

Icon
  • You can specify any number of the available options
  • Options are case sensitive

Options

--scriptsFolder=<VCS path> (Mandatory)

Path to the database scripts folder in source control. If it is the build VCS root, then enter: .

Example: --scriptsFolder=WidgetShop\Database\Scriptsfolder for a VCS path.

Example: --scriptsFolder=. for the VCS root.

--databaseServer=<server name> (Optional)

Database server name. Some other options will require this to be set - this is covered in their descriptions.

Example: --databaseServer=sql01.example.com\sql2008

--databaseName=<database name> (Optional. If set, this requires --databaseServer)

The target database to keep up to date with changes in source control. This must be an existing database on the server; sqlCI does not create the database for you.

If you want to deploy to multiple servers, we recommend using the switches below to create database packages and connect to Red Gate Deployment Manager.

Example: --databaseName=WidgetShop

--databaseIntegratedAuthentication (Optional)

Set this option to use Windows authentication with the SQL Server. This uses the Windows account the build agents run under. SQL authentication is used if this option is not set.

Icon

Don't set the --databaseIntegratedAuthentication option if you're using a build service such as TFS. It's unlikely that Windows account permissions will give you the access required to complete build service tasks. You should use SQL authentication instead.

--databaseUserName=<username> (Mandatory if --databaseServer is set and --databaseIntegratedAuthentication is not set)

Username for SQL authentication.

Example: --databaseUserName=sa

--databasePassword=<password> (Mandatory if --databaseServer is set and --databaseIntegratedAuthentication is not set)

Password for SQL authentication.

Example: --databasePassword=secret

--packageId=<package name> (Optional. If set, this requires --packageVersion)

Set this to create a NuGet package of the database and set the package name.

Example: --packageId=MyPackage

--packageVersion=<build.number> (Mandatory. If set, this requires --packageId)

Package build number.

Enter a number here to set the build number manually. If you run sqlCI.exe from the command line, you have to specify a number manually. If you're running sqlCI.exe as part of an automated build, you can use the build number variable to set this: on TeamCity, enter $(build_number) on CruiseControl.NET, enter $(CCNetLabel).

Example: --packageVersion=$(build_number)

--apiKeyForPackagePublish=<API key> (Optional. If set, this requires either --packageRepository or --deploymentManagerUrl and DeploymentManagerApiKey)

The API key of the NuGet Package Repository for publishing the package.

Example: --apiKeyForPackagePublish=00000000-0000-0000-0000-000000000000

--generateCreationScript (Optional)

Set this option to generate a script that will create the source database. The script appears as a build artefact.

--validateCreationScript (Optional. If set, this requires --databaseServer)

Set this option to create a test database on the database server you specified above. The database is created with a random name and dropped when the script has completed. Errors are reported in the output.

--generateUpgradeScriptForCurrentlyDeployedVersions (Optional. If set, this requires --deploymentManagerUrl)

Set this option to prepare upgrade scripts for all versions of the database currently deployed in Deployment Manager.

--generateUpgradeScriptFor=<version number list> (Optional. If set, this requires --deploymentManagerUrl or --packageRepository)

Prepare upgrade scripts for previous versions.

Specify a comma-separated list of database package versions to prepare upgrade scripts for.

Example: --generateUpgradeScriptFor=1.335,1.336,1.337,2.0

--validateUpgradeScript (Optional. If set, this requires --databaseServer)

Set this option to upgrade a test database of the previous versions from Deployment Manager. The databases are created with random names on the database server specified above and upgraded with the scripts. Errors are reported in the output.

--deploymentManagerUrl=<URL> (Mandatory if --generateUpgradeScriptForCurrentlyDeployedVersions is set. --deploymentManagerUrl OR --packageRepository is mandatory if --generateUpgradeScriptFor or --apiKeyForPackagePublish is set)

The URL of your Deployment Manager web interface.

Example: --deploymentManagerUrl=http://localhost:99/

--packageRepository=<url> (This or --deploymentManagerUrl is mandatory if --generateUpgradeScriptFor is set)

NuGet package repository URL for publishing and retrieving packages.

Example: --packageRepository=http://nuget.example.com/api/v2/

--deploymentManagerApiKey=<API key> (Mandatory if DeploymentManagerUrl is set)

The server key for Deployment Manager. You can find this in My Profile in the Deployment Manager web interface.

Example: --deploymentManagerApiKey=0123456789ABCDEF0123456789ABCDEF12345678

--sqlDataGeneratorProject=<VCS path> (Optional)

To populate the database with test data, enter the path to a SQL Data Generator project file. The path must be relative to the VCS root.

Example: --sqlDataGeneratorProject=WidgetShop\mysdgproject.datagen

--enableTsqlt (Optional. If set, this requires --databaseServer)

Set this option to run the source-controlled tSQLt tests for the database.

--sqlDocProject=<VCS path> (Optional. If set, this requires --databaseServer)

Enter the path to a SQL Doc project file to generate documentation to the database. The path must be relative to the VCS root.

Example: --sqlDocProject=WidgetShop\mydocproject.sqldoc

--additionalCompareArgs=<command line arguments> (Optional)

Enter any SQL Compare command line arguments you want to use.

Example: --additionalCompareArgs=IgnoreWhiteSpace /include:Identical

Icon

 If you want to enter a command line article that contains a space, you need to enclose the command in double quotes and insert escape characters before each quote. For example:

/TIL:\"READ COMMITTED\"

If you don't escape the double quotes, the option will be invalid.

--licenseSerialKey=<serial number> (Optional)

Automation license serial number. You can find your serial number on your invoice. If you do not enter a key, you will start a 28 day free trial.

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

Example: --licenseSerialKey=123-456-789012-ABCD

Example: --licenseSerialKey=123-456-789012-ABCD,321-456-987654-DCBA

--emailAddress=<email address> (Optional)

If you want to receive email notifications about updates to the product, enter an email address.

Example: --emailAddress=somebody@example.com


Didn't find what you were looking for?