Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help: error TRAPPING with sysmassages 1

Status
Not open for further replies.

Averno

Technical User
Feb 14, 2001
14
0
0
IT
After having trapped system errors with the @@errors variable, i find in the
master.dbo.sysmassages this description:
%ls statement conflicted with %ls %ls constraint '%.*ls'. The conflict
occurred in database '%.*ls', table '%.*ls'%ls%.*ls%ls.

The question is: is there a way to substitute that placeholders
(i.e.'%.*ls') with the REAL objects involved in the error? The books don't
help..

Thankyou.

 
Dear ;
Yes , you are right and this is an actual problem using @@Error in Stored Procedure and search error description in sysmessages of that error code.
For this, you have to maintain a separate table in which you
will enter Error Codes and their Description in your words which are understand by user easily. Find that Error Code in your Custom table and get description of that particular code. It may be a lengthy method but it is exceptable b/c you will find critical errors in your SP if you are using right syntax. You may find few errors like Null Values and Referentail Intigrity and Foriegn Key Constraint Errors in your SP and you can easily get the Error No. of all these errors.

Regards,
essa2000
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top