[TSQL] Unable to parse file

Hi Sonar team & community,

  • Enterprise EditionVersion 8.6 (build 39681), Plugin TSQL 3.4.1 , Code to scan on GitHub, team city (CI tool)
    WARN: Unable to parse file xxx Parse error at line 318 column 52:
    line 318: WHEN DATEDIFF(DAY, ISNULL(ua.LastActiondate, {d ‘1900-01-01’}), GETDATE()) < 30 THEN ‘Active’

  • steps to reproduce:

  • Install sonar 8.6 (build 39681)
  • Use a repository that have a file containing this sql code: WHEN DATEDIFF(DAY, ISNULL(ua.LastActiondate, {d ‘1900-01-01’}), GETDATE()) < 30 THEN ‘Active’
  • Scan the repo containing the code above
  • The parse error occurs for many lines of sql code

Hi,

It seems that our T-SQL parser doesn’t support ODBC datetime literals.
We will have to fix this problem: I created SONARTSQL-262 to track that.

Thanks a lot for your feedback!

1 Like