<pre>
use sybsystemprocs
go

if exists (select * from sysobjects where name = "sp_thresholdaction" 
           and type = 'P')
   drop proc sp_thresholdaction
go

create procedure sp_thresholdaction
@dbname varchar(30),
@segmentname varchar(30),
@space_left int,
@status int
as

--name: sp_thresholdaction
--author: Todd Boss 
--rev history
--date		auth		purpose
--2/13/97	Todd Boss	creation; adapted from Sybooks example
--3/27/97	Todd Boss	modified to dump tran w/ trunc only for 
--				development databases...eventually disabled
--				code in ~tboss/sql/sp_thresholdaction.dev.sql
--4/17/97	Todd Boss	fixed to dump to new dir; integrate w/ dtools
--
--
--dali: change dir to /news/prod11/transaction (was /export/sybase11/tran)
--pop: change dir to /export/sybase/prod 
--degas/zeus: not valid code in 4.9.2

--file format will be: master.lct.17.04.97.12:07:03 (4/17/97 at 12:07 and 3sec)

declare @curdate varchar(20)
declare @tranfile varchar(80)

select @curdate = getdate()

select @tranfile = "/news/prod11/transaction/"+@dbname+".lct."+
convert(char(8),getdate(),4) + "." + convert(char(8),getdate(),8)

dump transaction @dbname to @tranfile
print "LCT fired on '%1!'", @dbname        
go
