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 |
|
attinder3731
Starting Member
1 Post |
Posted - 2011-07-07 : 07:15:17
|
| hi,I want to retrieve Memory used,available memory and %used by all the databases present.I am using 'FILEPROPERTY' to get the details, but this is used only for the current database.I want to retrieve this data form all the databases present.Kindly suggest something.ThanksAttinder. |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-07-07 : 07:39:28
|
Think you mean disk space rather than memory.tryEXECUTE sp_msforeachdb 'select * FROM .sys.database_files'==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
vaari
Starting Member
15 Posts |
Posted - 2011-07-07 : 09:45:09
|
| Alternatively you could use the sys.master_files view which can be executed from the context of any database.And if you are looking for memory usage per database - http://www.johnsansom.com/how-much-memory-is-each-sql-server-database-using/#axzz1RQfSMY6i |
 |
|
|
|
|
|