srv_message_handler (Extended Stored Procedure API)
This feature will be removed in a future version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible. Use CLR integration instead.
Calls the installed Extended Stored Procedure API message handler. This function is usually used to call Microsoft SQL Server from an extended stored procedure to log an error (defined by the extended stored procedure) in the SQL Server error log file or the Microsoft Windows application log.
The srv_message_handler function enables an extended stored procedure to integrate with the centralized error logging and reporting features of SQL Server. SQL Server alerts can be established for events from extended stored procedures, and SQL Server Agent will monitor for these alert conditions.
If the error message is longer, it is truncated to 412 bytes.
You should thoroughly review the source code of extended stored procedures, and you should test the compiled DLLs before you install them on a production server. For information about security review and testing, see this Microsoft Web site.