Home > Archive > Microsoft SQL Server forum > September 2005 > Re: Is there a way to find growth in log (ldf) and database(mdf) ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Is there a way to find growth in log (ldf) and database(mdf) ?
Jens

2005-09-22, 3:23 am



I found that on Google and added some further stuff like ID and
Reporting Date in order to keep the information stored permantly, for
permanent storage of the table create a non-temporary one.:

create table #dbinfo
(
ReportId INT IDENTITY(1,1),
dbname sysname,
dbsize decimal(10,2),
dbused decimal(10,2),
ReportDate datetime DEFAULT GETDATE()
)


exec sp_MSforeachdb 'insert into #dbinfo(dbname, dbsize, dbused) select

''?'', dbsize = sum(convert(dec(15),
size))/128, (select
sum(convert(dec(15),
used))/128 from [?]..sysindexes where indid in (0,
1,
255)) from [?].dbo.sysfiles where status & 0x40 = 0'

Select * from #dbinfo

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com