Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Try/Catch syntax with the exact error
Message
 
 
To
05/03/2008 09:51:17
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01298895
Message ID:
01298898
Views:
10
This message has been marked as the solution to the initial question of the thread.
>I have some Try/Catch syntaxes which allows me to print in the Messages window some specific message when an error happens. But, in that message, I also need to print the exact error. How can I obtain that at that level?

It's covered in BOL. Excerpt:

ERROR_NUMBER() returns the number of the error.
ERROR_SEVERITY() returns the severity.
ERROR_STATE() returns the error state number.
ERROR_PROCEDURE() returns the name of the stored procedure or trigger where the error occurred.
ERROR_LINE() returns the line number inside the routine that caused the error.
ERROR_MESSAGE() returns the complete text of the error message. The text includes the values supplied for any substitutable parameters, such as lengths, object names, or times.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform