I am looking for a query validator in C#, which allows me to parse the SQL text from a textbox and verify whether it\'s correct or not before sending it for execution (MS SQ
Set your query to sql with this hint:
set PARSEONLY on
It just checks your query and returns, like this:
set PARSEONLY on select * from tablea
Returns no exception.
While
set PARSEONLY on select * f rom tablea
returns
Msg 102, Level 15, State 1, Line 2 Incorrect syntax near 'f'.