Debugging Stored Procedure in SQL Server 2008(调试 SQL Server 2008 中的存储过程)
问题描述
有什么方法可以调试 SQL Server 2008 上的存储过程?
Is there any way to debug a stored procedure on SQL Server 2008?
我有权使用 SQL Server Management Studio 2008 和 Visual Studio 2008(不确定两者是否提供此功能).
I have access to use SQL Server Management Studio 2008 and Visual Studio 2008 (not sure whether either provides this functionality).
通常我使用 SQL 分析器来查找传递给存储过程的参数,但是希望能够逐步执行该过程以查看它在哪里失败.
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.
这可能吗?
最好的方法是什么?(在快速查找bug位置方面)
What is the best way? (in terms of quickly finding location of bugs)
推荐答案
答案一直就在我面前.
在 SQL Server Management Studio 2008 中,工具栏中有一个调试按钮.在查询窗口中设置断点以单步执行.
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 基本上会自动执行 FinnNK 在 MSDN 演练中提到的内容.
SSMS basically does what FinnNK mentioned with the MSDN walkthrough but automatically.
太简单了!感谢您的帮助 FinnNK.
So easy! Thanks for your help FinnNK.
我应该在那里添加一个步骤来查找我在数据库上使用 SQL Profiler 的参数的存储过程调用.
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 中的存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:调试 SQL Server 2008 中的存储过程


基础教程推荐
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01