如何在sqlserver 2008中处理异常 [英] How to handle exceptions in sqlserver 2008

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

问题描述



我怀疑如何处理数据库中的异常(sqlserver2008)
以及如何处理存储过程中的异常.
请提供解决方案.

Hi,

i have an doubthow to handle exceptions in database (sqlserver2008)
and also how to handle exception in stored procedures.
please give solutions.

推荐答案

您始终可以在存储过程中进行TRY-CATCH

SQL Server中的异常处理 [ http://www.sommarskog.se/error-handling-I.html [ ^ ]

您需要考虑的是遇到异常时应采取的措施.您是否有应通知的客户端应用程序?或者,也许您只需要将详细信息记录在某处,以便发现问题并解决.
You can always TRY-CATCH in your stored procedures

Exception Handling in SQL Server[^]

Some more general info on error handling here

http://www.sommarskog.se/error-handling-I.html[^]

What you''ll need to consider is what you should do when an exception is encountered. Do you have a client application that should be notified? Or perhaps you just need to log the details somewhere so you can find the problem and fix.


这篇关于如何在sqlserver 2008中处理异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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