how to get error description in stored procedure

  • Hi,

    Anyone know that, how to get error description in stored procedure. I am getting the error number by @@ERROR. But i need error description.

    I tryed with sysmessages table. But there are many place holders. I need the exact error message like, how the query analyser giving. if any one know abt this please help me.

    Saravanan.


    Kindest Regards,

    Saravanan V
    geocities.com

  • From Books On Line:

    @@ERROR is the only part of a Microsoft® SQL Server™ 2000 error available within the batch, stored procedure, or trigger that generated the error. All other parts of the error, such as its severity, state, and message text containing replacement strings such as object names, are returned only to the application in which they can be processed using the API error handling mechanisms. Also, @@ERROR is raised only for errors, not for warnings; therefore, batches, stored procedures, and triggers do not have visibility to any warnings that may have occurred.

    This means that you'll need to use your application to display the errormessage and not the stored procedure.

    c

    If the phone doesn't ring...It's me.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply