Is it possible to parse T-SQL in exactly the same way as done by the SQL Server?
I suppose there is some code that SQL Server uses to build an AST from the given T-SQL. Is this code available for general audience?
Is it possible to parse T-SQL in exactly the same way as done by the SQL Server?
I suppose there is some code that SQL Server uses to build an AST from the given T-SQL. Is this code available for general audience?
You could use Microsoft.SqlServer.TransactSql.ScriptDom
The Microsoft.SqlServer.TransactSql.ScriptDom namespace provides Microsoft SQL Server-specific Parser and Script Generator support.
Example: A Program to Find INSERT Statements That Don’t Specify Columns