taozhi8833998 / node-sql-parser

Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList and convert it back to SQL
https://taozhi8833998.github.io/node-sql-parser/
Apache License 2.0
780 stars 174 forks source link

Unable to parse SET statements in Transact-SQL syntax #1876

Closed ZsharE closed 4 months ago

ZsharE commented 4 months ago

Describe the bug Unable to parse SET statements in Transact-SQL syntax. https://learn.microsoft.com/en-us/sql/t-sql/statements/set-statements-transact-sql?view=sql-server-ver16

Database Engine Transact-SQL

To Reproduce The SQL to be parsed:

SET NOCOUNT ON;
SET NOEXEC ON;
SET DATEFORMAT dmy;

...etc.

*SyntaxError: Expected "#", "--", "/", ":=", "=", or [ \t\n\r] but "O" found.**

node-sql-parser version 5.0.0 UMD browser script

Expected behavior The above SQL queries should parse.