This project has moved. For the latest updates, please go here.
Project Description
DeploymentPlanModifier for SqlPackager.exe to filter what actual gets deployed from a dacpac, you can choose to ignore or keep specific objects or types

To get started, grab the dll and put it in the same folder as sqlpackage.exe then use the parameter:

/p:AdditionalDeploymentContributors=AgileSqlClub.DeploymentFilterContributor

Which will load the filter.

Then to specify the criteria pass one or more key/values like:

/p:AdditionalDeploymentContributorArguments="SqlPackageFilter=IgnoreType(.*Proced.*)"

or you can now use negative flters to ignore or keep everything EXCEPT what matches the filter:

/p:AdditionalDeploymentContributorArguments="SqlPackageFilter=IgnoreType!(.*Proced.*)"

To use the negative filters, just put a ! before the regex which is surrounded by ()'s. Negative filters have no effect on IgnoreSecurity.

When you publish or create deployment scripts, then you can filter the output to either leave objects in place that aren't in the dacpac (Keep) or completely ignore object names, schema names or object types (Ignore).

Update 1 -

Required contributor with id 'AgileSqlClub.DeploymentFilterContributor' could not be loaded

  1. Fix 1
If you get this error then it might be a windows security issue because the file is downloaded, to fix it right click the dll after you have extracted it, go to properties and if you have an "unblock" button, click it and try again.
  1. Fix 2
The contributor requires the DacFx that comes with Sql 2014 - so basically make sure the folder that you put it in (or get the sqlpackage from) has 120 in the path and not 110.

Update 2 -

It looks like the SSDT team have released an update which allows you to ignore certain object types:

http://blogs.msdn.com/b/ssdt/archive/2015/02/23/new-advanced-publish-options-to-specify-object-types-to-exclude-or-not-drop.aspx

Great work SSDT Team! I would definitely recommend the out of the box solution where possible!

Update 3 -

1.4.1 now includes a new filter type "SqlPackageFilter=KeepTableColumns(Employees)" which will stop the columns on Employees being dropped if they are in the database but not the dacpac. See https://the.agilesql.club/blog/Ed-Elliott/2015/09/23/Deployment-Contributor-KeepTableColumns-Filter

Last edited Sep 25, 2015 at 2:21 PM by AgileSqlClub_EE, version 16