April 1, 2007 at 6:24 pm
I am trying to see the sizes of all the databases on a server so I can plan storage size for a new server with SAN storage. Is there a way to see or to script a query to see the size of each database on a server at one time?
Thank you.
April 2, 2007 at 1:10 am
Have a look at sp_databases (http://msdn2.microsoft.com/en-us/library/ms176070.aspx). You might want to check if the database size includes log files or not.
- James
--
James Moore
Red Gate Software Ltd
April 2, 2007 at 3:11 am
sp_databases gives you the size of the physical files for each db (data + logfiles)
If you also want to know how much space is actually used inside those files, you can use sp_spaceused.
To get the usage for all db's, you can use (undocumented, but useful)
exec sp_msforeachdb 'use ? exec sp_spaceused'
/Kenneth
April 2, 2007 at 7:48 am
PERFECT! Thank you. I hadn't thought about the log files. Those will need a drive of their own.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply