Skip to content

DacFx gives a false-positive constant warning on Synonym to User-defined datatype #327

@IVNSTN

Description

@IVNSTN
  • SqlPackage or DacFx Version: SSDT 16.0.62205.05200
  • .NET Framework (Windows-only) or .NET Core: 4.8 / 3.1
  • Environment (local platform and source/target platforms):
    • Windows 10
    • VS 2019 16.11.26

Such warnings cannot be fixed, only suppressed.

Steps to Reproduce:

  1. Create a new sqlproj
  2. Add a user-defined type to sqlproj
  3. Add a synonym for this type
  4. Get a warning

Code example (put to separate files as sqlproj requires):

CREATE TYPE dbo.MyType FROM INT;

CREATE SYNONYM MySynonym FOR dbo.MyType;

Scalar or table-valued type makes no difference.

Warning:
image

I understand that having synonyms to datatypes is a little bit weird scenario, but we have some and the warning anyways smells like false-positive.

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

PS
Speaking of SDK-style projects: if this is not fixed then one'd still have to mention all such files in the .sqlproj to put <SuppressTSqlWarnings>71502</SuppressTSqlWarnings> for hiding warnings purpose.

(DacFx/SqlPackage/SSMS/Azure Data Studio)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions