sqlpackage excluded type missing schema

Christopher Mire 1 Reputation point

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]...';
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.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,580 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Tom Phillips 17,716 Reputation points

    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.

  2. Mire, Chris 1 Reputation point

    I have found following enhancement request on DacFX repo which matches what I need.


    0 comments No comments