Getting detailed error message

  • I would like to be able to log all errors to a table but instead of just th error number I would like the completed details for example:

    Instead of just the first line is there a way to get the detailed information on the middle two lines of the error message table, column name and all.

    Server: Msg 515, Level 16, State 2, Line 1

    Cannot insert the value NULL into column 'test', table 'pubs.dbo.test'; column does not allow nulls. INSERT fails.

    The statement has been terminated.

     

    Thank you

    Stéphane Haché

  • Have you looked at sysmessages in master database. Thats has the description that you are looking for but you might have to add code to plug  in the table,column name.

    Thanks

    Sreejith

  • Have you seen all the possible variables??? gonna take quite a while to create this script... assuming you can access all those values.

     

    Couldn't the application generate the log using the "complete" error message?

  • I was wondering how sql server actually got the table and column name?

Viewing 4 posts - 1 through 3 (of 3 total)

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