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

SQL71501 Check Constraint has an unresolved reference to ARRAY #519

Open
phil000 opened this issue Nov 7, 2024 · 4 comments
Open

SQL71501 Check Constraint has an unresolved reference to ARRAY #519

phil000 opened this issue Nov 7, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@phil000
Copy link

phil000 commented Nov 7, 2024

  • SqlPackage or DacFx Version: SQL Server Data Tools 17.11.47.0
  • .NET Framework (Windows-only) or .NET Core: .NET Core 8
  • Environment (local platform and source/target platforms):

Steps to Reproduce:

  1. Create table using ISJSON check constraint, using the newer 'json_type_constraint' parameter
  2. You will get the error SQL71501: Check Constraint: 'x' has an unresolved reference to object [dbo].[RegionProxy].[ARRAY]
  3. Using the ISJSON without the 'json_type_constraint' parameter does not cause the error

Did this occur in prior versions? If not - which version(s) did it work in?
Not sure. Never needed ISJSON constraint prior to this.

(DacFx/SqlPackage/SSMS/Azure Data Studio)
Visual Studio 2022 17.11.5

e.g.

CREATE TABLE [dbo].[RegionProxy] (
    [RegionProxyId]        INT            IDENTITY (1, 1) NOT NULL,
    [RegionId]             INT            NOT NULL,
    [RegionName]           VARCHAR (150)  NOT NULL,
    [StandardWorkingDays]  NVARCHAR (100) NULL,
    [Version]              ROWVERSION     NOT NULL,
    CONSTRAINT [PK_RegionProxy_RegionProxyId] PRIMARY KEY CLUSTERED ([RegionProxyId] ASC),
    CONSTRAINT [CK_RegionProxy_StandardWorkingDays] CHECK (isjson([StandardWorkingDays],ARRAY)>(0))
);
@phil000 phil000 added the bug Something isn't working label Nov 7, 2024
@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 7, 2024

@phil000 Have you tried VS 17.12 preview?

@phil000
Copy link
Author

phil000 commented Nov 7, 2024

No sorry I have not. I'm not really able to use a preview version.

@phil000
Copy link
Author

phil000 commented Nov 15, 2024

@ErikEJ I've upgraded to VS 17.12.0 now it is released and the issue has been resolved.

This is working

CONSTRAINT [CK_RegionProxy_StandardWorkingDays] CHECK (isjson([StandardWorkingDays], ARRAY)>(0)),

@phil000
Copy link
Author

phil000 commented Nov 15, 2024

However I still get the same thing on the Azure build agents. I presume we just need to wait for them to update the installed software.

##[error]Tables\RegionProxy.sql(11,90): Error SQL71501: Check Constraint: [dbo].[CK_RegionProxy_StandardWorkingDays] has an unresolved reference to object [dbo].[RegionProxy].[ARRAY]

Please close this issue.

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

2 participants