Closed volodymyr-svystun closed 1 week ago
It looks like you're trying to parse ScriptDom or something similar. All the default dialects meet the ANSI/ISO SQL standard which would not validate your script. In order to use alternative dialect features, you would need to implement a custom dialect and use it as an argument then parsing.
https://github.com/TylerBrinks/SqlParser-cs?tab=readme-ov-file#supporting-custom-sql-dialects
@TylerBrinks thank you for helping. Will try to add an own dialect
Hello,
Thanks for your nice utility to work with sql queries. I faced incorrect validation for my query. Let's look at the next code ` var sql = """ SELECT * FROM MyTable WHERE ( (IIF((C0 & CAST(1 AS BIGINT) <> 0), 1, 0)) > 1 ) """;
If I run my sql in management studio it executes without any errors. But sql parser returns 1 error: "Incorrect syntax near ')'." Column: 50 Line: 7 Offset 110
When I validate the same sql only IIF is not in parentheses. it validates without any error:
var sql = """ SELECT * FROM MyTable WHERE ( IIF((C0 & CAST(1 AS BIGINT) <> 0), 1, 0) > 1 ) """;
Parentheses are important for my code, so I cannot get rid of them/ Could you please look into this?