Tracing Exceptions and user errors in profiler back to actual code

  • I would like a way to record any time there is a user error and the SQL that generated that error. Using profiler I don't see a way to programatically correlate the exception message, the user error message, and the SQL:BatchStarting/SP:Starting text data fields.

    I hate seeing errors like 'Invalid length parameter passed to the RIGHT function.' and not being able to quickly see the actual code or SP that caused the error.

    Obviously the SPID is linked between these, but the SPID is only linked for that split second between execution and error, and then that SPID is re-used for a different process. Could I somehow trigger on the exception and grab DBCC input buffer?

    Any thoughts?

  • You might be able to do it using Extended Events.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

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

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