如何在存储过程中查找SQL异常。 [英] How to find the SQL exception in stored procedure.

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

问题描述

How to find the sql exception in stored procedure.





我尝试过:



如何在存储过程中找到sql异常。尝试捕获是正确的方法或任何其他事情是找出异常



What I have tried:

How to find the sql exception in stored procedure. try catch is proper approach or any other things are there to find out exceptions

推荐答案

请参阅我对该问题的评论。我无法理解你的意思,也不确定你理解你想要达到的目标,抱歉。



无论如何,异常处理是Transact-SQL的特性,它是SQL的扩展,所以你可能想从这里开始:

尝试.. .CATCH(Transact-SQL)

Transact-SQL



然而,很可能,您需要了解异常处理的工作原理,这不是一个简单的主题,尽管几乎每个人都使用异常处理。我试着在过去的答案中解释一般的想法:

C#构造函数导致调用者分配失败?

操作系统中存储了.net异常的地方



这个话题非常基础和严肃,需要真正的教育;我的回答可以被认为只是提示,充其量。



-SA
Please see my comment to the question. I cannot understand what you mean and not sure that you understand what you want to achieve, sorry.

Anyway, exception handling is the feature of Transact-SQL, which is the extension to SQL, so you may want to start here:
TRY...CATCH (Transact-SQL),
Transact-SQL.

However, mostly likely, you need to understand how exception handling works, which is not a trivial topic, despite the fact that nearly everyone uses exception handling. I tried to explain just the general idea in my past answers:
Does Exception in C# Constructor Cause Caller Assignment to Fail?,
where was stored .net exceptions in operating system.

The topic is quite fundamental and serious, takes real education; my answered can be considered as just the hint, at best.

—SA


这篇关于如何在存储过程中查找SQL异常。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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