• Agreed.

    The cases where I would use that RAISERROR would be when I'm running admin scripts that I only run very infrequently.

    I've done similar (though less fancy) things with a log table when I've got scripts that run as part of a scheduled job. That can be very handy if you have lots of exceptions.

    Another thing I like to do is specify an output file when I'm setting up job steps. That really helps with troubleshooting if you have your scripts providing good output when failures or exceptions happen.

    The Redneck DBA