WARN: Parse error starting from line in .SQL file

We are using Azure SQL 12.0 version and Visual Studio 2019 to create the SQL Database project.
We are using Azure DevOps for our CI and latest MSbuild version to build our SQL database solution. But we are getting
WARN: Parse error starting from line [Line number] at lines 7, 10, 16, 17, 25, 34 and 46 in the attached file. Could you please help here? I have removed the actual insert statements and other columns, tables details for confidentiality purpose. DML.txt (1.2 KB)

Greetings Sumanth,

Can you work a bit on the formatting of your post? It’s a bit tough to decipher.

Thank you for replying, I have copied the SQL statements in to a text file. Please take a look at it.

Greetings Colin, any update on the issue?

Hi Sumanth,
what suffix does your SQL file have?
.sql is treated by SonarQube as PL/SQL. But when you analyze T/SQL with the PL/SQL parser you usually get a lot of parse errors.
If this is the case, either rename your files to *.tsql, or configure your project in SonarQube:
Navigate to:
Administration->General Settings->Languages

  1. Select “PL/SQL” and remove the ‘sql’ suffix
  2. Select “T-SQL” and add the ‘sql’ suffix

Regards,
Matthias

1 Like

Hi @Colin_SonarSource,

I do not know who defined your post to be the solution, but I would vote for the post of @bugbouncer as solution. This is exactly what I did to solve this issue. Are you able to change this?

@Daniel.Schiffer The OP marked it as the solution (@sumanthkr) before @bugbouncer posted. :slight_smile: Sometimes that just means they figured it out themselves. :man_shrugging:

Are you associated with @sumanthkr (facing/faced the precisely same parsing errors)?

Hi @Colin_SonarSource,

Yes, I faced the same issues and struggled some time on the solution. Fortunately, I found the file extension settings in SonarQube.

This worked, thank you very much.