title: How can I parse dynamic SQL before execution in T-SQL?
body: <p>I'd need to know how to parse a query to know if it is well build before executing it. If the parsing is correct then execute it, if not discard it.</p>
  
  <p>I haven't been able to accomplish this using SET NOEXEC, SET PARSEONLY, TRY/CATCH.</p>
  
  <p>I m using <em>dynamic sql</em> inside a loop. Sometimes the <em>dynamic sql</em> is incorrect not for my fault but for the information existing in the database. For this reason I would like to parse it before execution. </p>