如何在Visual Studio 2012中调试SQL Server T-SQL [英] How to debug SQL Server T-SQL in Visual Studio 2012
问题描述
当遵循与VS 2010相同的步骤时,断点不会在sproc中打。
为了确保一切都正常启用,我可以在SQL Server 2008 R2 Express数据库中的sproc中调试T-SQL浏览了VS 2010的说明( here ),但对于VS 2012或.NET 4.5,不存在此类页面。
似乎缺少的一个步骤是启用应用程序调试,但是在VS 2010中的服务器资源管理器>数据连接上下文菜单。
VS 2010应用程序调试
VS 2012无应用程序调试
您需要打开SQL Server对象资源管理器不是服务器资源管理器。那就是2010年和然后右键单击服务器并选择应用程序调试。
How does one debug a T-SQL stored procedure in a multi-tier application in Visual Studio 2012?
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.
When following the same steps as for VS 2010, the breakpoints aren't hit inside the sproc.
Debugging T-SQL in a sproc on a SQL Server 2008 R2 Express database works as expected in Visual Studio 2010.
To be sure everything was enabled properly, I went over the instructions for VS 2010 (here), but no such page exists for VS 2012 or .NET 4.5.
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.
VS 2010 Application Debugging
VS 2012 No Application Debugging
You need to open "SQL Server Object Explorer. Not "Server Explorer". That is what is different between 2010 & 2012. Then right click on the server and select "Application Debugging".
这篇关于如何在Visual Studio 2012中调试SQL Server T-SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!