• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

How to export a detailed list of sql 2005 database information

I am trying to get a exported list of sql databases from my sql 2005 server.  I believe you used to be able to do this in 2000.  I am looking for db name, db sizes and db/logs locations.

Thanks,
Tom
0
wnc123
Asked:
wnc123
  • 3
  • 2
  • 2
  • +1
1 Solution
 
wnc123Author Commented:
I dont understand what "select name from sys.databases"  is?  Can you provide more information?
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
wnc123Author Commented:
Much better but I would also like db size and location.  Do you know of any way to get this also without it being manual process.

Thanks,
Tom
0
 
hyphenpipeCommented:
select * from sys.database_files will get you the current DB's info that you are looking for.
0
 
hyphenpipeCommented:
select * from sys.master_files gets you every database on the instance.
0
 
hyphenpipeCommented:
Just as an FYI, the name stored in this table is the logical name of the database which may or may not reflect the name you might see in physical name.  Chances are it does but if it doesn't and you require the physical name you would need to join the sys.databases table to return that value.  Something like:

select d.name, mf.physical_name, size from sys.master_files mf
 inner join sys.databases d on d.database_id = mf.database_id
0
 
Anthony PerkinsCommented:
>>I dont understand what "select name from sys.databases"  is? <<
Are you familiar with SQL Server BOL?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now