Share via

sqlpackage DropObjectsNotInSource=True with all types excluded vs DropObjectsNotInSource=False

Mire, Chris 1 Reputation point
2022-08-18T18:25:34.397+00:00

I am currently getting errors trying to deploy some primary key changes with sqlpackge. The error is "This deployment may encounter errors during execution because changes to {...} are blocked by {...}'s dependency in the target database".

I noticed that if I specify DropObjectsNotInSource=True it works fine. I think trying excluding various types to see what type was causing issue and found that even if I say to not drop anything, it still works. I'm not sure if this is a bug or not, but seems suspicious. It would be nice if when /Diagnostics was on, sqlpackage would give info on that above error, about what the dependency is"

Here is full flags I'm using
/p:DropObjectsNotInSource=True /p:DoNotDropObjectTypes="Aggregates;ApplicationRoles;Assemblies;AssemblyFiles;AsymmetricKeys;BrokerPriorities;Certificates;ColumnEncryptionKeys;ColumnMasterKeys;Contracts;DatabaseOptions;DatabaseRoles;DatabaseTriggers;Defaults;ExternalDataSources;ExternalFileFormats;ExternalTables;Filegroups;Files;FileTables;FullTextCatalogs;FullTextStoplists;MessageTypes;PartitionFunctions;PartitionSchemes;Permissions;Queues;RemoteServiceBindings;RoleMembership;Rules;ScalarValuedFunctions;SearchPropertyLists;SecurityPolicies;Sequences;Services;Signatures;StoredProcedures;SymmetricKeys;Synonyms;Tables;TableValuedFunctions;UserDefinedDataTypes;UserDefinedTableTypes;ClrUserDefinedTypes;Users;Views;XmlSchemaCollections;Audits;Credentials;CryptographicProviders;DatabaseAuditSpecifications;DatabaseEncryptionKeys;DatabaseScopedCredentials;Endpoints;ErrorMessages;EventNotifications;EventSessions;LinkedServerLogins;LinkedServers;Logins;MasterKeys;Routes;ServerAuditSpecifications;ServerRoleMembership;ServerRoles;ServerTriggers;ExternalStreams;ExternalStreamingJobs;ExternalLibraries;ExternalLanguages"

Any chance there could be an 'All' type added, incase this list is added or removed from in future?

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.