title: How to debug SQL Server T-SQL in Visual Studio 2012
body: <p>How does one debug a T-SQL stored procedure in a multi-tier application in Visual Studio 2012? </p>
  
  <p>To be clear, I want to set a breakpoint in a sproc in VS 2012, and hit it when the sproc is called from an ASP.NET WebForms app in the same debugging session.</p>
  
  <p>When following the same steps as for VS 2010, the breakpoints aren't hit inside the sproc.</p>
  
  <p>Debugging T-SQL in a sproc on a SQL Server 2008 R2 Express database works as expected in Visual Studio 2010.</p>
  
  <p>To be sure everything was enabled properly, I went over the instructions for VS 2010 (<a href="http://msdn.microsoft.com/en-us/library/ms165059%28VS.100%29.aspx" rel="noreferrer">here</a>), but no such page exists for VS 2012 or .NET 4.5.</p>
  
  <p>It seems the missing step is to enable "Application Debugging", but no such option exists in the Server Explorer > Data Connections context menu in VS 2012.</p>
  
  <h2>VS 2010 Application Debugging</h2>
  
  <p><img src="https://i.stack.imgur.com/Bwu6O.png" alt="enter image description here"></p>
  
  <h2>VS 2012 No Application Debugging</h2>
  
  <p><img src="https://i.stack.imgur.com/wGYRt.png" alt="enter image description here"></p>