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 |
marcus.vanwyk
Starting Member
2 Posts |
Posted - 2010-06-15 : 08:53:47
|
Hi Guys.Can someone please assist me.We have SQL Server 2008, this server contain about 40 - 50 DB that have been created over the last few years, and I would like to start consolidating the DB's and getting rid of those we do not use any more.Can someone help me with a script that will show me the following if possible.DB NameMDF LocationLDF LocationDB Data File SizeDB Log File SizeDate Last accessed / Read or Write (If possible)Any help / pointers would be appreciated. |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-06-15 : 10:36:58
|
For all but the last, query sys.databases and sys.master_files.The last access (read/write) to a DB is not logged anywhere in SQL. If you want that, you need some form of trace.--Gail ShawSQL Server MVP |
 |
|
|
|
|