|
Posted by Erland Sommarskog on 05/03/06 10:43
davidz (davidz@oz.net) writes:
> When a catchable error occurs in a try block, control is passed to the
> associated catch block. While I am then able to examine properties of
> the error using such functions as ERROR_NUMBER() in the catch block,
> the error-logging scheme used in my company requires that the actual
> error be raised so that it can be picked up by components in the next
> tier. I appear to be unable to do that
Correct. There is no re-raise operation in SQL 2005.
There is a fairly good work around. Just create a custom message, and then
format that message to include all essential information. The middle-tier
components will need to be adapted so if they this particular error number,
for instance 55555, they need to parse the message text to get the
components.
The new error-handling stuff in SQL 2005 is definitely too good to be
ignored!
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|