Skip to content

Fix for 4819285, adding setting to prevent generated project files to include SET ANSI_NULLS OFF#771

Closed
allancascante wants to merge 3 commits intomainfrom
dev/acascante/fix_generate_script_set_ansi_nulls_off
Closed

Fix for 4819285, adding setting to prevent generated project files to include SET ANSI_NULLS OFF#771
allancascante wants to merge 3 commits intomainfrom
dev/acascante/fix_generate_script_set_ansi_nulls_off

Conversation

@allancascante
Copy link
Copy Markdown

@allancascante allancascante commented Mar 23, 2026

Description

When using a SQL project (.sqlproj) as the source for schema compare instead of a .dacpac, the generated publish script includes unwanted SET ANSI_NULLS OFF commands before each object's CREATE statement. This occurs because the SDK's Sdk.props did not define default AnsiNulls or QuotedIdentifier metadata on Build items, causing DacFx to interpret the missing values as OFF. This fix adds an ItemDefinitionGroup in Sdk.props that defaults AnsiNulls and QuotedIdentifier to On for all Build items, matching the behavior of traditional SSDT projects and the behavior when using a .dacpac as source. A new test (VerifyBuildItemDefaultAnsiNullsOn) validates that Build items carry the correct default metadata. Fixes #172.

Code Changes

  • Unit tests are added, if possible
  • Existing tests are passing
  • New or updated code follows the guidelines here
  • Ensure .dacpac from changes to Microsoft.Build.Sql build process MUST be backwards compatible with older versions of SqlPackage
  • Use proper logging for MSBuild tasks

@llali
Copy link
Copy Markdown
Member

llali commented Mar 25, 2026

@allancascante please close this if not needed anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated script using .scmp file as source contains unwanted SET ANSI_NULLS OFF commands

2 participants