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 2005 Forums
 SQL Server Administration (2005)
 how to check which .mdf file is being used?

Author  Topic 

pb
Starting Member

13 Posts

Posted - 2009-07-15 : 18:28:19
Hi,

I am working on a installation program dealing with Vista virtualization, which includs database file (.mdf) relocation.

It will be very helpful if I can use some commandline or navigate somewhere (like ODBC) to see which .mdf file (I could have up to 3 copies of the same .mdf file - old location, new location, virtualized) is being used by the database. Currently ODBC 'System DSN' didn't show file location information for data sources with 'SQL Server' as Driver.

Any help is highly appreciated.


Thanks,
PB

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2009-07-15 : 18:40:17
[code]
use MyDatabase
select filename from sysfiles
[/code]

CODO ERGO SUM
Go to Top of Page

pb
Starting Member

13 Posts

Posted - 2009-07-15 : 18:52:59
Thank you so much, Michael. I will try that.


Regards,
PB
Go to Top of Page
   

- Advertisement -