The SQL Error Handler is designed to create unified logging and notification of SQL execution exceptions. This product can be used in conjuction with the Messenger product to automatically report SQL exceptions periodically (just set up a Messenger record with the query SELECT * FROM SQL_Errors WHERE ErrorDateTime > $LASTRUN$).
Once you've cloned this repo, installation is a snap: To install everything, just run the script InstallErrorHandler.sql (change the USE Utils to your database name if needed; Error Handler can reside in any database you wish), this will create the error logging table (
Once you've created the objects, you'll want to review the parameter default values in the stored procedure
When you have everything set up the way you want, just call the stored procedure from all your CATCH blocks and let it do the rest! Assuming you have the default parameter values set the way you want (although you can always pass params for specific use cases), your call will be this simple:
EXEC HandleError
If you discover any bugs or additional feature requests, please send me an email!