0

I'm trying to use SSDT to update schema on a target database based on a source database.

sqlpackage.exe /a:Script /sf:source.dacpac /tf:target.dacpac /tdn:"MyTargetDB" /op:update.sql /p:ExcludeObjectTypes="Users;RoleMembership"

I'm using the ExcludeObjectTypes property to prevent the script to create users on target. But my update.sql still contains this section:

GO
PRINT N'Creating [username]...';

GO
CREATE SCHEMA [username]
    AUTHORIZATION [username];

Is it possible to exclude this as well?

dhrm
  • 14,335
  • 34
  • 117
  • 183
  • Try to play with the publish config settings in the UI and get this exclusion working. Then check what setting was excluded in publish profile and exclude the same in command line – Dmitrij Kultasev Sep 22 '17 at 05:24
  • You may want to try creating a Publish Profile and setting those options there. I've done that and don't have any issues w/ users that I don't want to create. Schema could be another issue, but those extra schema shouldn't be in your project. – Peter Schott Sep 22 '17 at 15:46

0 Answers0