December 17, 2003 at 12:09 pm
refer previous post
How does one go about getting free log space using a Query?
December 17, 2003 at 1:37 pm
With DBCC SqlPerf(LogSpace) you can get the percentage free and the total log size.
Use the following script to get free and used log space.
create table #logspace
( dbname varchar(50),
logsize numeric(14,6),
perc_used numeric(14,6),
status int )
insert into #logspace
exec ('dbcc sqlperf(logspace)')
select 'Database' = dbname,
'Log Space Used (MB)' = (logsize * perc_used / 100),
'Log Space Free (MB)' = logsize - (logsize * perc_used / 100),
'Log Space Total (MB)' = logsize
from #logspace
drop table #logspace
Edited by - mdaniel on 12/17/2003 1:38:31 PM
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply