Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
DeepGround
Yak Posting Veteran
73 Posts |
Posted - 2009-07-02 : 13:06:56
|
Hello!I have a simple script:exec sp_msforeachdb "print '?'"which lists the name of each database followed by a carridge return.Does anyone know a way I could add the database size to the output for example:master 21MBtempdb 3489MBClients 489689MBetc etc |
|
mcrowley
Aged Yak Warrior
771 Posts |
Posted - 2009-07-02 : 13:37:08
|
[code]select db_name(dbid), sum(size)/128 as "Size in MB"from master..sysaltfilesgroup by dbid[/code] |
|
|
DeepGround
Yak Posting Veteran
73 Posts |
Posted - 2009-07-02 : 13:39:11
|
WoW! And it is so efficient!! Thank you |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-02 : 13:42:49
|
sp_databases |
|
|
|
|
|