Missy SD
Missy SD

Reputation: 1

Can DB schema objects(like tables, SP, Function or views) be excluded from DACPAC through custom configuration?

Currently our project has one common DACPAC, due to this, when any new projects are being developed, the SQL components are deployed much before the actual release of the project.

Basically DACPAC usually deploys whole Data Base. I need to see if there is any exception I can set which help us in not deploying certain tables, SP, Function or views.

Upvotes: 0

Views: 211

Answers (1)

Paul Maxwell
Paul Maxwell

Reputation: 35583

You can use sqlPackage.exe to restrict the changes by specifying the types you don’t want to deploy with the parameter /p:ExcludeObjectTypes. e.g.

/p:ExcludeObjectTypes="StoredProcedures;ScalarValuedFunctions;TableValuedFunctions"

to exclude stored procedures, scalar-valued functions, and table-valued functions from being deployed.

Alternatively, you can use the /p:ExcludeObjectFromChangeScript parameter to exclude specific objects from the deployment script and customize the deployment process by avoiding deploying unnecessary components.

sqlpackage.exe /Action:Publish /SourceFile:MyDatabase.dacpac 
               /TargetDatabaseName:MyDatabase 
               /p:ExcludeObjectFromChangeScript=MyStoredProcedure
               

nb: line break for readability only

see:

Upvotes: 0

Related Questions