Deployment Manager 2

Help for older versions available.

Using filters in database deployment

You can use filters to control which objects are deployed when you deploy a database with Deployment Manager. These are the same as the filters used in SQL Compare and SQL Source Control.

Filters need to be included in a database package to be applied when that package is deployed. The filter must be named filter.scpf in the root of the db/state folder in the package.

You can add a filter to a package two ways:

  • Use SQL CI (part of the SQL Automation Suite) to create the package and include a filter file in it. This is useful if you want to create an individual package with a filter or automate the package creation.
  • Add the filter with SQL Source Control and package it using the Deployment Manager SSMS add-in. This is useful if you want to create multiple packages from SQL Server Management Studio.

Creating a package including a filter file

Requirements

To create a package including a filter file, you must have:

  • DLM Automation Suite (previously called the SQL Automation Pack)
  • SQL Compare
  1. Create the filter you want to use. For more information, see Using filters in the SQL Compare documentation.
  2. Save the filter with the name filter.scpf. For more information, see Saving and deleting filters in the SQL Compare documentation.
  3. Use SQL CI to create a scripts folder. For more information, see Creating and publishing a database package using the command line.
  4. Copy filter.scpf file into temporary_folder.
  5. Publish the package. For more information, see Publish the package with sqlCI.exe.

Adding a filter to a database package with SQL Source Control

Requirements

  1. In SSMS, use SQL Source Control to create the filter and commit it to source control. For more information, see Using filters to exclude objects in the SQL Source Control documentation.
  2. Use the SSMS add-in to publish the latest revision of the database from SQL Source Control. For instructions, see Publishing database packages from SSMS and select SQL Source Control at step 3.
  3. The filter will be applied when you deploy your package,

Didn't find what you were looking for?