title: How can I debug an EXCEPTION_ACCESS_VIOLATION on SQL Server 2008
body: <p>An application that uses a database broke suddenly. I started to investigate and noticed that a simple count query </p>
  
  <pre><code>SELECT count(uberdataid) FROM [Alexander].[dbo].[UberData]
  </code></pre>
  
  <p>creates an error in SQL Server: </p>
  
  <blockquote>
    <p>Msg 0, Level 11, State 0, Line 0 A severe error occurred on the
    current command.  The results, if any, should be discard</p>
  </blockquote>
  
  <p>A few thoughts: </p>
  
  <ul>
  <li><p>When I check out the error's stack trace it says that there is an EXCEPTION_ACCESS_VIOLATION. The name of that exception makes me think that there might be a permissions issue in the query. But I  get this exact same error on many different user accounts (which all were able to query the DB without issue before).</p></li>
  <li><p>This discussion on SO (  <a href="https://stackoverflow.com/questions/1098392/exception-access-violation-in-sql">Exception Access Violation in SQL</a>) makes me think that the query might be hitting a lingering record lock, but I've rebooted the server so that seems unlikely.</p></li>
  </ul>
  
  <p>There are also some other unresolved discussions on other message boards online.</p>
  
  <p>Any ideas? </p>
  
  <p>Stackoverflow won't let me post the whole trace (too long) but I am happy to post relevant parts if people need to see them. I don't know what parts from the trace are most important to post.</p>