如何在Sql Server 2008中调试存储过程 [英] How to Debug Stored Procedure in Sql Server 2008

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

问题描述


我正在使用存储过程从数据库而不是SQL查询中检索数据.

如何逐步调试Sql Server 2008中的存储过程?

如果有人告诉我.

问候
Nanda Kishore.CH

解决方案

以下是如何执行此操作的基本演练:

http://msdn.microsoft.com/en-us/library/yet1b7by% 28VS.80%29.aspx [ ^ ]




好吧,答案一直都在我眼前.

在SQL Server Management Studio 2008中,工具栏中有一个调试"按钮.在查询窗口中设置断点以逐步执行.

一开始我就取消了此功能,因为我没想到要跨入存储过程,您可以轻松地做到这一点.

SSMS基本上会自动执行FinnNK在MSDN演练中提到的内容.



我应该在其中添加一个步骤,以查找在数据库中使用过SQL Profiler的参数的存储过程调用.

http://msdn.microsoft.com/en-us/library/yet1b7by% 28VS.80%29.aspx [ ^ ]


http: //msdn.microsoft.com/zh-CN/library/ms174763.aspx [ http://stackoverflow.com/questions/1793612/debugging-stored-procedure- in-sql-server-2008 [ ^ ]
http ://venkatb4me.wordpress.com/2011/03/09/steps-to-debug-stored-procedure-of-sql-server-2008-using-visual-studio-2010/ [ ^ ]
http://beyondrelational. com/modules/2/blogs/88/posts/10151/sql-server-2008-tsql-debugger-for-stored-procedure.aspx [ 解决方案

Here is a basic walkthrough of how to do this:

http://msdn.microsoft.com/en-us/library/yet1b7by%28VS.80%29.aspx[^]


Hi

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.



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

http://msdn.microsoft.com/en-us/library/yet1b7by%28VS.80%29.aspx[^]


http://msdn.microsoft.com/en-us/library/ms174763.aspx[^]
http://stackoverflow.com/questions/1793612/debugging-stored-procedure-in-sql-server-2008[^]
http://venkatb4me.wordpress.com/2011/03/09/steps-to-debug-stored-procedure-of-sql-server-2008-using-visual-studio-2010/[^]
http://beyondrelational.com/modules/2/blogs/88/posts/10151/sql-server-2008-tsql-debugger-for-stored-procedure.aspx[^]


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

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