Executes automatically when the number of free pages on the log segment falls below the last-chance threshold, unless the threshold is associated with a different procedure. Sybase does not provide this procedure.


When a threshold is crossed, Adaptive Server passes the following parameters to the threshold procedure by position:

sp_thresholdaction @dbname,



is the name of a database where the threshold was reached.


is the name of the segment where the threshold was reached.


is the threshold size, in logical pages.


is 1 for the last-chance threshold; 0 for all other thresholds.


Example 1

Creates a threshold procedure for the last-chance threshold that dumps the transaction log to a tape device:

create procedure sp_thresholdaction 
        @dbname varchar(30),
        @segmentname varchar(30),
        @space_left int,
        @status int
        dump transaction @dbname to tapedump1


Waking suspended processes

See also

Commands create procedure, dump transaction

System procedures sp_addthreshold, sp_dboption, sp_dropthreshold, sp_helpsegment, sp_helpthreshold, sp_modifythreshold, sp_who