在SQL Server 2008中调试存储过程 [英] Debugging Stored Procedure in SQL Server 2008

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

问题描述

有没有办法在SQL Server 2008上调试存储过程?



我可以使用SQL Server Management Studio 2008和Visual Studio 2008(不知道是否提供此功能)。



通常,我使用SQL分析器来查找传递给存储过程的参数,但是希望能够通过该过程来查看它在哪里失败。



这是可能吗?



最好的方法是什么? (在快速找到错误的位置方面)

解决方案

那么答案就是坐在我面前, / p>

在SQL Server Management Studio 2008中,工具栏中有一个调试按钮。在查询窗口中设置一个中断点。



我在开始时驳回了此功能,因为我没有想到将INTO转入存储过程,您可以轻松做



SSMS基本上是用MSDN演练,但是自动地提到的FinnNK。



很容易!感谢您的帮助FinnNK。



编辑:
我应该添加一个步骤来找到我的数据库中使用SQL Profiler的参数的存储过程调用。


Is there any way to debug a stored procedure on SQL Server 2008?

I have access to use SQL Server Management Studio 2008 and Visual Studio 2008 (not sure whether either provides this functionality).

Generally I use the SQL profiler to find the parameters passed to the stored proc, however would like to be able to step through the procedure to see where it is failing.

Is this possible?

What is the best way? (in terms of quickly finding location of bugs)

解决方案

Well the answer was sitting right in front of me the whole time.

In SQL Server Management Studio 2008 there is a Debug button in the toolbar. Set a break point in a query window to step through.

I dismissed this functionality at the beginning because I didn't think of stepping INTO the stored procedure, which you can do with ease.

SSMS basically does what FinnNK mentioned with the MSDN walkthrough but automatically.

So easy! Thanks for your help FinnNK.

Edit: I should add a step in there to find the stored procedure call with parameters I used SQL Profiler on my database.

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

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