执行的嵌套存储过程 [英] Executed Nested Stored Procedure

查看:81
本文介绍了执行的嵌套存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨Frnds,

我怀疑我们是否可以执行嵌套的存储过程.在我们的单个页面中,我们有多个insert,delete,update命令..我们希望将其转换为存储过程,也正在使用事务..如果没有错误发生,则事务提交,否则它将回滚所有命令...现在我的问题是如何在单个sp中执行所有DML命令.我的想法是在内部使用try catch块和事务创建一个sp ...在BEGIN内部尝试执行另一个存储过程...如果发生错误,则回滚嵌套存储过程命令也可以..它是否可以工作...欢迎任何建议....

Hi Frnds,

I hav a doubt whether we can execute a nested stored procedures.. I.e. in our single page we have multiple insert,delete,update commands.. we like to convert it to stored procedure also we are using transactions.. if no error occurs transaction commit otherwise it will rollback all commands... now what my question is how to execute all DML commands in a single sp.. MY idea is to Create a one sp inside that use try catch block and transaction... Inside BEGIN Try execute a another stored procedure... if error occurs rollback a nested stored procedure commands also.. it will work or not... Any suggestions pls welcome....

推荐答案

是的,可以在SP中完成...您可以同时使用错误处理和事务处理
yes it can be done...in SP...you can use both error handling and transactions


这篇关于执行的嵌套存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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