There is no way to do what you are describing in SSDT deployments. The project expects all objects to exist in the project, or not. There is not a way to specify some should and others should be removed.
sqlpackage excluded type missing schema

sqlpackage.exe doesnt have a way to specify to ignore schema's. If I pass /p:DropObjectsNotInSource=True it wants to drop all schemas outside my dacpac when publishing. For example it generates this if I am deploying a dacpac that does not have "CREATE SCHEMA [abc]]" defined
PRINT N'Dropping SqlSchema [abc]...';
DROP SCHEMA [abc];
GO
There is no type I can pass to p:DoNotDropObjectTypes to have it not drop these.
If list of types can not be adjusted to have schema, maybe an additional flag can be added like "DropSchemasNotInSource=(BOOLEAN)". I have checked Microsoft.SqlServer.Dac.ObjectType and there is no value for Schema currently.
2 answers
Sort by: Most helpful
-
Tom Phillips 17,616 Reputation points
2022-08-19T17:31:40.547+00:00 Mire, Chris 1 Reputation point2022-08-24T13:02:45.133+00:00 I have found following enhancement request on DacFX repo which matches what I need.
That one is a different issue.
This is really a feature/bug item for team that maintains sqlpackage.exe. If this is not right place to make such a request, please let me know where to make it.