Sybase database occupation
Sybase database occupation script set nocount on declare @pgsize float --select @pgsize = (1048576. / v.low) from master.dbo.spt_values v where v.number = 1 and v.type = 'E' select @pgsize = 1048576 / @@maxpagesize select 'DbName' = substring(d.name, 1, 30), 'Usage' = convert(varchar(15),substring(m.description, 1, 14)), 'Size' = convert(varchar(13),right(space(13) + convert(varchar(10),convert(decimal(10,1), sum(u.size) / @pgsize)),10) + ' Mo'), --'Used' = convert(varchar(13),right(space(10) + convert(varchar(10),convert(numeric(10,1), 'Used' = convert(varchar(13),right(space(10) + convert(varchar(10),convert(decimal(10,1), sum(size - convert(float,curunreservedpgs(d.dbid,u.lstart, u.unreservedpgs))) / @pgsize)),10) + ' Mo'), 'Free' = convert(varc...