|
Posted by Jens on 10/01/66 11:27
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
Navigation:
[Reply to this message]
|