title: How to interpret SQL Server errors?
body: <p>Whenever I make a syntax error in a SQL Server query, I get an error message which I find pretty hard to interpret. For example the error that I have right now is</p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1, Procedure myQuery, Line 3 [Batch Start Line 57]<br>
    Incorrect syntax near '!'.</p>
  </blockquote>
  
  <p>I used <code>table!column</code> instead of <code>table.column</code>. I fixed my problem because I understood this bit:</p>
  
  <blockquote>
    <p>Incorrect syntax near '!'</p>
  </blockquote>
  
  <p>However, I do not understand how to interpret this message</p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1, Procedure myQuery, Line 3 [Batch Start Line 57]  </p>
  </blockquote>
  
  <p>Do people usually just ignore that part? I have been getting along just fine without paying much attention to it. But being able to understand the error message might help be locate exactly where the error is.</p>
  
  <p>Edit:</p>
  
  <p>I don't understand what Msg, Level, State, Batch and Start Line means</p>
  
  <p>Edit2:</p>
  
  <p>Besides the accepted answer <a href="http://tomaslind.net/2013/10/15/line-numbers-in-t-sql-error-messages/" rel="nofollow noreferrer">this</a> link also helped me clear up my misunderstanding of what line number means. I always thought that line number meant the line in the SQL query where the error is which confused me. Turns out the line number is the line in the query window. To enable line number in query editor window go to :</p>
  
  <p><strong>Tools > Options > Text Editor > Transact-SQL > General >Line Numbers</strong></p>
  
  <p>Press OK</p>