Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-sqlserver > #1488
| Newsgroups | comp.databases.ms-sqlserver |
|---|---|
| Date | 2013-05-21 07:16 -0700 |
| References | <ab1bae77-157c-4440-b342-230649e1e8d3@googlegroups.com> |
| Message-ID | <9fc73eac-be2f-4930-a035-a7d9dbfd2548@googlegroups.com> (permalink) |
| Subject | Re: Hi Experts i have doubt |
| From | rja.carnegie@gmail.com |
On Tuesday, 21 May 2013 14:27:33 UTC+1, n wrote: > have MS SQL 2008 R2, 500 databases. What is the most efficient, easiest and 'modern' way to query all databases sizes. > > The output should have columns: > > •DatabaseName > > •DataFilesSize > > •LogFilesSize I've only got SQL Server 2005; here, the system catalog view, sys.master_files, has the information you're looking for. You'll need DB_NAME([database_id]) for the first column, and, to have the MDF/NDF and log file sizes side by side in a row, you're going to need one of those "PIVOT" bits, I suppose. I can never remember how to do that. But it is "modern". ;-)
Back to comp.databases.ms-sqlserver | Previous | Next — Previous in thread | Next in thread | Find similar
Hi Experts i have doubt n <nsubbu1986@gmail.com> - 2013-05-21 06:27 -0700
Re: Hi Experts i have doubt rja.carnegie@gmail.com - 2013-05-21 07:16 -0700
Re: Hi Experts i have doubt Erland Sommarskog <esquel@sommarskog.se> - 2013-05-21 21:22 +0200
Re: Hi Experts i have doubt SUBBU N <nsubbu1986@gmail.com> - 2013-05-27 00:44 -0700
Re: Hi Experts i have doubt Erland Sommarskog <esquel@sommarskog.se> - 2013-05-27 23:24 +0200
Re: Hi Experts i have doubt rja.carnegie@gmail.com - 2013-05-27 19:02 -0700
Re: Hi Experts i have doubt Erland Sommarskog <esquel@sommarskog.se> - 2013-05-28 08:29 +0200
csiph-web