Creating a package
Published 06 February 2013
To create a package:
- Create schema and data scripts for packaging using the SQL Compare and SQL Data Compare command lines. For more information, see:
Open a Command Prompt window in the folder where you installed SQL Packager 8.
To do this, navigate to the folder, then hold Shift, right-click and select Open command window here.
Alternatively, open a Command Prompt window anywhere and change directory to the folder where you installed SQL Packager 8. For example:
cd "C:\Program Files (x86)\Red Gate\SQL Packager 8"
- At the command prompt, type sqlpackager.
Specify the paths of the scripts you want to package, and a name and location for the package, and press Enter.
The package is created in the specified location.
To package the schema and data of database WidgetSales as WidgetSalesUpgrade.exe in C:\Packages:
sqlpackager /schemascript:"C:\Scripts\WidgetSalesSchema.sql" /datascript:"C:\Scripts\WidgetSalesData.sql" /outputfolder:"C:\Packages" /name:WidgetSalesUpgrade.exe
The path of the schema script you want to package. You must specify either /schemascript or /datascript. You can specify multiple paths as a comma-separated list.
The path of the data script you want to package. You must specify either /schemascript or /datascript. You can specify multiple paths as a comma-separated list.
/name:<name of executable> (optional)
The name of the package that will be created. You don't have to append .exe onto the file name. If you don't specify a name, the current date and time will be used, eg package-2014-11-13-1137.exe.
/outputfolder:<folder path> (optional)
The folder where the package will be created. If you don't specify a folder, the package will be created in the current folder.
Overwrites any existing package in the output folder that has the same name as the new package.