title: Origin of warning message in sql server
body: <p>I'm getting warnings like these when running a stored procedure:</p>
  
  <pre><code>Warning: Null value is eliminated by an aggregate or other SET operation.
  </code></pre>
  
  <p><strong>I know what the warning means</strong>, but what stored procedure and line number is causing it?</p>
  
  <p>The thing is that the stored procedure is gigantic and calls a dozen other procedures. So it becomes very hard to localize the problem when SQL Server doesn't give you the line number and procedure name where the warning originates. This is using SQL Server 2008.</p>