Additional SQL Server features and topics not covered by specific categories
I've found the relevant flag:
/p:ScriptDatabaseOptions=False
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi
I'm running the below sqlpackage action command (my change is only one predeploy script with one alter):
sqlpackage /action:Script /SourceFile:"Database Services\bin\Debug\Database Services.dacpac" /TargetConnectionString:"Data Source=TESTL05,123;Integrated Security=True;Persist Security Info=False;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=60;Encrypt=False;TrustServerCertificate=False;Initial catalog=test" /OutputPath:"C:\git\SnapshotDiff.sql
and when I'm looking in the sql I see this code:
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET ANSI_NULL_DEFAULT ON
WITH ROLLBACK IMMEDIATE;
END
why this part was generated? can I avoid it using of one of these flags:
https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-script?view=sql-server-ver15#properties-specific-to-the-script-action
Additional SQL Server features and topics not covered by specific categories
Answer accepted by question author
I've found the relevant flag:
/p:ScriptDatabaseOptions=False