Capture severity 10 error

  • Is there some way to capture

    "The module '% depends on the missing object '%'. The module will still be created; however, it cannot run successfully until the object exists."

    errors?

    It does not cause the CATCH clause of TRY...CATCH to trigger...

    Any ideas?

  • AFAIK, errors with severity 10 or lower can't be captured as they're basically warnings.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Bit of a kludge, but I've found a way. In short,

    - create a trace to capture User Error Message events

    - script out the trace definition

    - start the trace

    - run sp_refreshsqlmodule on all modules

    - stop the trace

    - get the results: SELECT TextData FROM fn_trace_gettable('<output file>.trc', 1) WHERE TextData is not null

    - delete trace (optional)

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

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