如何在Visual Studio 2012中调试SQL Server T-SQL [英] How to debug SQL Server T-SQL in Visual Studio 2012

查看:658
本文介绍了如何在Visual Studio 2012中调试SQL Server T-SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Visual Studio 2012中的多层应用程序中调试T-SQL存储过程?要清楚,我想在VS 2012中的sproc中设置一个断点,并在spoc从同一个ASP.NET WebForms应用程序调用时打到它调试会话。



当遵循与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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆