Skip to content

dzsquared/Dac-PublishContributor

Repository files navigation

Sample DacFx Deployment Contributors for Filtering by Object Name or Schema

Project Description

Scope reduction from the Microsoft DACExtensions samples.

Prerequisites

An installation of SQL Server Data Tools or DacFx is required to run these samples. The sample projects include references to DLLs in a Visual Studio installation with the most recent release of SQL Server Data Tools.

The compiled dlls can be utilized with the DacFx installation included with SQL Server Data Tools, the DacFx Windows-only DacFx.msi, or the cross-platform SqlPackage.exe.

Usage

Abbreviate use information:

  1. Build the samples in Visual Studio
  2. Copy the dll Public.Dac.SampleDeploymentFilter.dll into the DacFx extensions folder or folder with SqlPackage
  3. Execute the publish command with additional properties /p:AdditionalDeploymentContributors and /p:AdditionalDeploymentContributorArguments

Example 1, Does not publish object named "Customer"

./sqlpackage.exe /a:Publish /sf:"c:\sampledatabase.dacpac" /tsn:yourservername /tu:sa /tp:yourpassword /p:AdditionalDeploymentContributors=Public.Dac.SampleFilters.PlanFilterer /p:AdditionalDeploymentContributorArguments="FilterName=ObjectBasedFilter;ObjectName=Customer"

Example 2, Does not publish the dbo schema

./sqlpackage.exe /a:Publish /sf:"c:\sampledatabase.dacpac" /tsn:yourservername /tu:sa /tp:yourpassword /p:AdditionalDeploymentContributors=Public.Dac.SampleFilters.PlanFilterer /p:AdditionalDeploymentContributorArguments="FilterName=SchemaBasedFilter;Schema=dbo"

License

This project continues to carry the MIT License from the parent project, DACExtensions samples.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages