<pre>
use sybsystemprocs
go

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

create procedure sp_checklog (@mode char(1) = NULL)
as     

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              Software Systems Development Corporation
                Copyright 1993 - All Rights Reserved
-------------------------------------------------------------------------
                     Procedure Creation Script
-------------------------------------------------------------------------
   Procedure Name: sp_checklog
          Version: 2.0
     Date Created: Jan 19, 1993
------------------------------------------------------------------------
Sofware Systems Development Corporation
3221 North 24th Street, Suite L.
Phoenix, Arizona 85016
Bus: (602) 956-9304

John S. Barton
December 8, 1993

This code may be used freely without charge.  It may not be
redistributed in a modified form, in whole or in part, without
written consent from the Software Systems Development Corporation,
nor may it be sold for profit, in whole or in part. This notice
must remain attached to the code below.

Sofware Systems Development Corporation, and its affiliates, make
no claims as to the efficacy of this code, and provide no warranty.
Use of this code is at your own risk, Sofware Systems Development
Corporation accepts no liability for its use, nor responsibility
for its maintencance.

Please send bug fixes and enhancements to asjsb@asuvm.inre.asu.edu
------------------------------------------------------------------------
          Purpose:  This procedure checks the size of the log in the
                    database that it is executed from. This code came
                    from the SYBASE Trouble Shooting Guide and is
                    may be inaccurate by as many as 16 pages.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

declare @logsize real,
        @dbname varchar(20),
        @rsize varchar(70)
set nocount on

select @dbname = db_name()

select @logsize=data_pgs (8,doampg)
  from sysindexes
 where id = 8
if ( @logsize < 512 )
  begin
    select @rsize = rtrim(convert(char(20),round((@logsize * 2048)/1000,2)))
    select @rsize = @dbname + " log size " + @rsize + " Kbytes. at "+
           convert(char(30),getdate(),109)
    if @mode = 'B' select @rsize else print @rsize
  end
else
  begin
    select @rsize=rtrim(convert(char(20),round((@logsize * 2048)/1048576,2)))
    select @rsize=@dbname + " log size " + @rsize + " Mbytes. at "+
           convert(char(30),getdate(),109)
    if @mode = 'B' select @rsize else print @rsize
  end
return(0)

go

grant execute on sp_checklog to public
go 
