This project has moved and is read-only. For the latest updates, please go here.
You need to pass the filter as a parameter to sqlpackage.exe, you will need to first put the dll in the same folder as sqlpackage.exe and then use this command to load the filter:

/p:AdditionalDeploymentContributors=AgileSqlClub.DeploymentFilterContributor


Because of the limitations on the parameters we can pass on the command line you need to use something like:

/p:AdditionalDeploymentContributorArguments="SqlPackageFilter=IgnoreSchema(BLAH)"

Thete is a special filter for security objects:

/p:AdditionalDeploymentContributorArguments="SqlPackageFilter=KeepSecurity"

The exact format of the filters is:

"Keep" or "Ignore" Then "Name", "Schema", "Type" or "Security" Finally the regex in parenthesis: "(Regex)"

The ( and ) are removed simply so you can use these within the regex without escaping them.


To pass multiple filters, you have two choices you can either use the argument SqlPackageXmlFilterFile and pass the name of an xml file as the value with xml that looks like:

<Filters>
<Filter Operation="Keep" Type="Schema" MatchType="DoesNotMatch">.*func.*</Filter>                                                                                 <Filter Operation="Ignore" Type="Security" MatchType="DoesMatch" />
</Filters>


The second option is to use the SqlPackageFilter as above but just something unique onto the end of each one such as:

/p:AdditionalDeploymentContributorArguments="SqlPackageFilterA=IgnoreSchema(BLAH);SqlPackageFilter99=IgnoreSchema(BLAH);SqlPackageFilterEE=IgnoreSchema(BLAH)"

If you want to know why and maybe do something to fix the oddness of it, vote this up: https://connect.microsoft.com/SQLServer/feedback/details/1112969

Last edited Feb 2, 2015 at 10:08 PM by AgileSqlClub_EE, version 6