TSQL: More parsing errors

Currently running:

  • SonarScanner for MSBuild 4.6.2
  • SonarQube Scanner
  • Windows 2016 Server

This is in relationship to:

and bug: https://jira.sonarsource.com/browse/MMF-1593

Following statements are not being parsed:

Anything around modifying procedures:
CREATE PROCEDURE [dbo].[sp_MyDatabase]
ALTER PROCEDURE [dbo].[sp_MyDatabase]
DROP PROCEDURE [dbo].[sp_MyDatabase]

Table variables:
DECLARE @tblUpdated TABLE ( [Id] INT , [Active] BIT , [Reason] NVARCHAR (50));

Hi Joshua,

Which version of SonarTSQL do you have? (latest is

Could you confirm that parse errors come from SonarTSQL and not SonarPLSQL? In the sonar-scanner logs, what do you see above the error?
INFO: Sensor T-SQL Sensor [tsql]
INFO: Sensor PL/SQL Sensor [plsql]

Because using SonarTSQL I can parse the following code:

CREATE PROCEDURE [dbo].[sp_MyDatabase] AS
   DECLARE @tblUpdated TABLE ( [Id] INT , [Active] BIT , [Reason] NVARCHAR (50));

ALTER PROCEDURE [dbo].[sp_MyDatabase] AS PRINT 'Test';

DROP PROCEDURE [dbo].[sp_MyDatabase];

But if I map *.sql files to SonarPLSQL, I have the following errors:

INFO: Sensor PL/SQL Sensor [plsql]
WARN: Unable to fully parse: test.sql
WARN: Parse error starting from line 1



Yup. It’s Sensor PL/SQL Sensor.

How do I remap the scanner to SonarTSQL?

Hi Joschua,

You can change those SonarQube properties:

  • Administration > General Settings > PL/SQL > File Suffixes
  • Administration > General Settings > T-SQL > File Suffixes

Or in sonar-project.properties and on sonar-scanner command line you can set:

  • sonar.plsql.file.suffixes
  • sonar.tsql.file.suffixes

For example:

  • PL/SQL *.sql -> *.plsql
  • T-SQL *.tsql -> *.sql,*.tsql