I have an SSDT project with VS2015 and using SqlPackage.exe to generate deployment scripts and incremental update scripts. The database project contains post deployment scripts. here's how I generate the main script for DB installation:
sqlpackage.exe
/a:Script
/op:"database.sql"
/sf:"database.dacpac"
/tsn:"localhost"
/tdn:"MyDbName"
/p:CommentOutSetVarDeclarations="True"
/p:ScriptDatabaseCompatibility="True"
/p:IgnoreFileAndLogFilePath="True"
/p:IgnoreFilegroupPlacement="True"
/p:ScriptFileSize="True"
/p:PopulateFilesOnFilegroups="False"
This will output database.sql file which I run with sqlcmd.exe. the script file also contains all my post deployment scripts (Insert, Update, etc..)
Once I have a new version of the database, I create incremental update script from previously taken dacpac snapshot:
sqlpackage.exe
/a:Script
/op:"%migratePath%\%database%.!build!-%version%.sql"
/sf:"%snapshotPath%\%database%.%version%.dacpac"
/tf:"%snapshotPath%\%database%.!build!.dacpac"
/tdn:"MyDbName"
/p:CommentOutSetVarDeclarations="True"
/p:AllowIncompatiblePlatform="True"
/p:IgnorePermissions="True"
/p:IgnoreRoleMembership="True"
/p:ExcludeObjectTypes=Users;Credentials;Logins;Permissions;RoleMembership;ServerRoles;ServerRoleMembership;
this works fine, however, incremental update script does not contain metadata/reference data (e.g. e.g. list of countries, states, currencies, etc.).
Is there a way to tell SqlPackage to generate incremental script that contains the table reference data as well?