title: SQL Server Query log for failed/incorrect queries?
body: <p>I am using SQL Server 2008 and I would like to know if there's a way to find invalid SQL queries that have been executed in a database. For example:</p>
  
  <pre><code>SELECT * FROM NonExistingTable
  </code></pre>
  
  <p>...where the database didn't exist or a <code>SELECT/INSERT/UPDATE</code> with incorrect syntax.</p>