从.NET代码调试SQL Server存储过程 [英] SQL Server debug Stored Procedure from .NET code

查看:93
本文介绍了从.NET代码调试SQL Server存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法可以在从.NET代码中调用存储过程时对其进行调试?我有什么可能?

I'm wondering if there's a way to debug a stored procedure at the time it's called from .NET code? What are my possibilities?

我正在使用Visual Studio 2013 Community Edition和SQL Server 2014

I'm using Visual Studio 2013 Community Edition and SQL Server 2014

推荐答案

我已经设法自己弄清楚了.

I have managed to figure it out myself.

它与VS 2010中的内容非常相似.

It's quite similar to what you can find in VS 2010.

  1. 我必须将数据库作为项目导入到我的解决方案中.
  2. 在我的应用程序项目属性中打开SQL调试.
  3. 重新打开我的项目.
  4. 通过SQL Server对象资源管理器连接到我的SQL数据库.
  5. 右键单击我先前连接的SQL Server,然后检查应用程序调试".
  6. 找到我要调试的SP,双击它,设置我的断点(它说不会被击中,但最终会被击中).
  7. 使用调试器启动我的应用程序.

现在一切正常,调试器毫无问题地在我的断点处停止.

Everything now works as expected, the debugger stops at my breakpoint with no problem.

这篇关于从.NET代码调试SQL Server存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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