2

Is there a documented or at least vaguely documented way to make use of the SQL Server batchparser.dll that's hidden away deep inside the SQL Server directory structure (C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn)?

Would that be a possibility to submit a T-SQL batch and have it parsed for syntax errors?

2

1 Answer 1

1

Based on David Brabant's link (http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.batchparser(v=sql.110).aspx) this dll just parses the input text into batches (e.g. text between separate GO statements). The specific function to do the parsing is

http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.batchparser.batchparser.parse(v=sql.110).aspx

You might find the TSqlParser class more useful:

http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.transactsql.scriptdom.tsqlparser.aspx

or SqlParser namespace:

http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.sqlparser.parser(v=sql.120).aspx

Not the answer you're looking for? Browse other questions tagged or ask your own question.