MS SQL Server 2019+: Unable to parse file due to "ADD SENSITIVITY CLASSIFICATION"

  • versions used: SonarCloud
  • error observed: Sonar is unable to parse file with valid SQL syntax for target database (Azure SQL for me, but 2019+ is valid too)
19:37:37.931 WARN: Unable to parse file '/D:/a/1/s/Database/DNN/dbo/Tables/Roles.sql' : Parse error at line 32 column 1:

22:     [SecurityMode]         INT             CONSTRAINT [DF_Roles_SecurityMode] DEFAULT ((0)) NOT NULL,
23:     [IsSystemRole]         BIT             CONSTRAINT [DF_Roles_IsSystemRole] DEFAULT ((0)) NOT NULL,
24:     CONSTRAINT [PK_Roles] PRIMARY KEY CLUSTERED ([RoleID] ASC),
25:     CONSTRAINT [FK_Roles_Portals] FOREIGN KEY ([PortalID]) REFERENCES [dbo].[Portals] ([PortalID]) ON DELETE CASCADE,
26:     CONSTRAINT [FK_Roles_RoleGroups] FOREIGN KEY ([RoleGroupID]) REFERENCES [dbo].[RoleGroups] ([RoleGroupID]),
27:     CONSTRAINT [IX_RoleName] UNIQUE NONCLUSTERED ([PortalID] ASC, [RoleName] ASC)
28: );
29: 
30: 
31: GO
32: ADD SENSITIVITY CLASSIFICATION TO
    ^
33:     [dbo].[Roles].[SecurityMode]
34:     WITH (LABEL = 'Confidential', LABEL_ID = 'f010a6f5-9aae-43a5-bd7c-098dddaa2b25', INFORMATION_TYPE = 'Other', INFORMATION_TYPE_ID = '9c5b4809-0ccc-0637-6547-91a6f8bb609d', RANK = MEDIUM);
35: 
  • steps to reproduce: Scan Sql Server Data Tools project targeting Azure SQL with SENSITIVITY CLASSIFICACTION
  • potential workaround: None

Hey there.

Thanks for letting us know. There’s already a ticket raised (SONARTSQL-263) on this – in the meantime you can ignore the warning or exclude the file from the analysis. There’s currently no ETA on a fix.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.