从调用sp调试调用的存储过程时遇到问题 [英] Having problem debugging a called stored procedure from a calling sp

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

问题描述

我在调试存储过程时遇到问题,该存储过程正在调用另外两个人



当我尝试调试时,它不会向下钻取到被调用的存储过程。 />


1.如何访问和深入查看被调用的存储过程?



2.被叫存储过程不计算如何从调用存储过程调试被调用的存储过程



3编码是对吗?



谢谢



IF @ ZEQUALPAY ='简单利益'

BEGIN



EXEC sp_new_Runu @ ZIDNO,@ ZLOANUMBER,@ ZPERIOD,@ ZYEAR

END



IF @ ZEQUALPAY ='减少平衡'

BEGIN





EXEC sp_new_Runz @ ZIDNO,@ ZLOANUMBER,@ ZPERIOD,@ ZYEAR


结束



我尝试过:



i已经从互联网上的代码研究

I am having problem debugging a stored procedure which is calling two others

When i tried to debug it does not drill down to the called stored procedure.

1. How do I access and drill down to the called stored procedure?

2. The called stored procedure is not calculating how do I debug the called stored procedure from the calling stored procedure

3 Is the coding right?

Thanks

IF @ZEQUALPAY='SIMPLE INTEREST'
BEGIN

EXEC sp_new_Runu @ZIDNO,@ZLOANUMBER,@ZPERIOD,@ZYEAR
END

IF @ZEQUALPAY='REDUCING BALANCE'
BEGIN


EXEC sp_new_Runz @ZIDNO,@ZLOANUMBER,@ZPERIOD,@ZYEAR

END

What I have tried:

i HAVE RESEARCHED FROM THE CODES ON THE INTERNET

推荐答案

这里有一个关于调试存储过程和函数的相当详细的博客 - 调试SQL查询,函数和& SQL Management Studio集成调试器的存储过程 - 忍者日记 [ ^ ]



返回当我使用SQL2005时,我们没有这样的工具,所以我会使用设置的参数单独调用存储过程,每过一步就按层次结构进行操作。



我还习惯将很多RAISERROR语句放入我的代码中作为PRINT语句,这样我就可以跟踪发生的事情(将它们用于生产)。这里有一篇关于这种技术的文章 - 让RAISERROR像PRINT一样工作 [ ^ ]
There is a fairly detailed blog about debugging Stored Procedures and Functions here - Debugging SQL Queries, Functions, & Stored Procedures with SQL Management Studio’s Integrated Debugger - Diary Of A Ninja[^]

Back in the day when I was using SQL2005 we had no such tool, so I would call the Stored Procedures individually with set parameters, working my way up the hierarchy as each bit passed.

I also used to put a lot of RAISERROR statements into my code to act as PRINT statements so I could track what was happening (took them out for production). There is an article on that technique here - Making RAISERROR work like PRINT[^]


这篇关于从调用sp调试调用的存储过程时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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