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 |
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 |
 |
|
X002548
Not Just a Number
15586 Posts |
|
anilkdanta
Starting Member
25 Posts |
Posted - 2006-09-09 : 02:43:12
|
If you know the database name, use this SPexec sp_helpdb 'dbname' |
 |
|
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 |
 |
|
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. |
 |
|
|
|
|