Returning Error Message with Error Number

  • Hi All,

    We need to be able to get details on unpredictable errors happening in Stored Procs. Getting the error number returned is not a problem, but we need to get the message as well, with the relevant parameters (ie not %L ) as this gives us a starting point. Without the full message the error number itself is a bit pointless in this case.

    ALL HELP APPRECIATED.

    Cheers

    Aethyr Dragon


    The Aethyr Dragon

    Cape Town
    RSA

  • all error messages are in master.dbo.sysmessages i believe;

    so you'd select @err=@@error in your proc, then

    select description from master.dbo.sysmessages where error=@err

     

    if the severity was such that a run time error was raised, You could look up the error number in this table.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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