Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behavior of CONSTRAINT DEFAULT CAST(0 AS BIT) in dacpac converted to CONVERT([bit],(0) in target DB #537

Open
ssreerama opened this issue Dec 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ssreerama
Copy link

  • SqlPackage or DacFx Version: Both
  • .NET Framework (Windows-only) or .NET Core: Both
  • Environment (local platform and source/target platforms): All

Steps to Reproduce:

  1. Create a database and create a table (below syntax) in SSMS
    2.CREATE TABLE [dbo].[Demo] ( [DemoId] INT IDENTITY (1, 1) NOT NULL, [Field1] BIT CONSTRAINT [Field1Constraint] DEFAULT CAST(0 AS BIT) NOT NULL );
  2. When script out the created the table, you can observe the CAST(0 AS BIT) changes to CONVERT([bit],(0)).
  3. Since both are same according to the engine, but dacfx fails to recognize them and generated the differences, which might cause drop and recreating then column/ater table/ rebuild as well in some scenarios.

Did this occur in prior versions? If not - which version(s) did it work in?

(DacFx/SqlPackage/SSMS/Azure Data Studio) All

@ssreerama ssreerama added the bug Something isn't working label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant