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 中的存储过程
- SQL 临时表问题 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
