This page describes how to create and publish a database package using the version of SQL CI available in SQL Automation Pack v1.0.4.2 and earlier. If you're using a later version of the SQL Automation Pack, see Using the sqlCI.exe command line in SQL Automation Pack v1.1 and later. The SQL Automation Pack was replaced by the DLM Automation Suite on 31st March 2015. If you're using a version of SQL CI included in the DLM Automation Suite, use the commands described in Using the sqlCI.exe command line. |
You can use the SQLCompare.exe and sqlCI.exe command lines to create and publish database packages. You can then use Deployment Manager to deploy database packages to target SQL servers.
You will need:
Optionally, license sqlCI.exe by running:
sqlCI.exe --licenseSerialKey=[automation license serial number] |
If you don't license sqlCI.exe, it'll start a 2 week trial. |
To create a temporary scripts folder of your target database, use the SQL Compare command line:
Run the following command:
SC\SQLCompare.exe /server1:[server] /database1:[database] /makescripts:temporary_folder |
Where:
This creates a scripts folder of the database in a folder called temporary_folder.
For more information, see Switches used in the SQL Compare command line. |
To package and publish the database to Deployment Manager, run the following sqlCI.exe command:
sqlCI.exe --scriptsFolder=temporary_folder --packageId=[package name] --packageVersion=[version number] --packageRepository=[package repository] --apiKeyForPackagePublish=[DM API key] --generateCreationScript |
Where:
This will package and publish the scripts folder that you created with SQLCompare.exe.
For information, see Using the sqlCI.exe command line in SQL Automation Pack. |
Use the command line to delete the temporary scripts folder you created.
Run the following command:
rd /s /q temporary_folder |
Where:
This removes the temporary folder and all its subfolders.
This is particularly useful if you want to script the publishing of a package. |