错误处理概念 [英] Error handing concept

查看:87
本文介绍了错误处理概念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在研究SQL Server 2005中的错误处理功能.现在,我想要SQL Server 2005中的错误处理概念(请仅向我提供概念而不是源代码).

#1.我用TRY…CATCH编写代码,并使用带有错误消息的RAISEERROR函数.
问题:我得到有关错误的各种信息.我不仅需要这些信息.

#2.创建错误表并将错误和相关信息存储在该表中.
发出如何从最外层CATCH块上的表中检索错误信息.我可以为此使用唯一ID并将其传递给RAISEERROR函数.

请向我提出解决方案,如果您还有其他方法来处理SQL Server 2005中的错误,请向我提供帮助.我非常感谢您.

我真的需要强有力的错误处理计划.

在此先感谢.

Hi All,

I am working on error handing functionality in SQL Server 2005. Now I want concept of error handling in SQL Server 2005 (Please provide me only concept not source code).

#1. I write a code with TRY…CATCH and use RAISEERROR function with error message.
Issue : I am getting very sort information about error. I require more than these information.

#2. Create error table and store error and relative information in that table.
Issue how to retrieve error information from that table on outer most CATCH block. Can I use unique ID for that and pass that it in the RAISEERROR function.

Please suggest me solutions and if you have any other way for error handing in SQL Server 2005 please provide me I am very thank full to you.

I really need strong error handing plan.

Thanks in Advance.

推荐答案

看看这些:

SQL Server 2005中的错误处理概述 [ SQL Server 2005中的有效错误处理 [
Have a look at these:

Overview of Error Handling in SQL Server 2005[^]

Effective Error handling in SQL server 2005[^]

hope it helps :)


请像这样看看.

MSDN在这里说创建错误日志表,并将身份输出到外部CATCH块.

在Transact-SQL中使用TRY ... CATCH

感谢您提供解决方案1.:)
Please have a look at this like.

Here MSDN says create error log table and output the Identity to outer CATCH block.

Using TRY...CATCH in Transact-SQL

Thanks for Solution 1.:)


这篇关于错误处理概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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