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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 mdf and ldf files

Author  Topic 

ninel
Posting Yak Master

141 Posts

Posted - 2006-09-08 : 14:36:24
Is there some sort of command that can tell me which mdf and ldf files are associated to which databases?

Thanks,
Ninel

Kristen
Test

22859 Posts

Posted - 2006-09-08 : 14:40:36
[code]
select name, filename from master.dbo.sysdatabases
[/code]
will give you a bit of a start and then
[code]
select name, filename from MY_DATABASE_NAME.dbo.sysfiles
[/code]
will show you the Logical / Physical names per database.

Kristen
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-09-08 : 15:49:53
No standards?

You can also go in to EM and Right click on the database and select properties to see the path and filename for each

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page

anilkdanta
Starting Member

25 Posts

Posted - 2006-09-09 : 02:43:12
If you know the database name, use this SP

exec sp_helpdb 'dbname'
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-09-09 : 03:58:36
"No standards?"

I've got standards! But it doesn't stop me restoring a database to an accidentally-wrong-name

Kristen
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-09-09 : 15:12:20
Or renaming a database.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -