Creating threshold procedures

Sybase does not supply threshold procedures. You must create these procedures yourself to ensure that they are tailored to your site’s needs.

Suggested actions for a threshold procedure include writing to the server’s error log and dumping the transaction log to increase the amount of log space. You can also execute remote procedure calls to an Open Server or to XP Server. For example, if you include the following command in sp_thresholdaction, it executes the procedure mail_me on an Open Server:

exec openserv...mail_me @dbname, @segment

See Chapter 16, "Using Extended Stored Procedures," in the Transact-SQL User’s Guide for more information on using extended stored procedures and XP Server.

This section provides some guidelines for writing threshold procedures, as well as two sample procedures.