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?
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