Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesI 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
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread