April 29, 2005 at 5:39 am
How can I determine the path names to the MDB and LOG files that contain the data for a particular Database ? I'd hoped that DATABASEPROPERTYEX might have told me, but it doesn't 🙁
Thanks,
Steve
April 29, 2005 at 6:06 am
Use (mydb)
select * from sysfiles
This will give you the full path where your .mdf and .ldf files are located.
--Kishore
April 29, 2005 at 6:13 am
select * from sysfiles will work for u in QA
Also in EM u can slect DB>Right Clk> Properties>Clk Dtafiles or Transaction Log .Below u Can see Location of the DB.
April 29, 2005 at 6:17 am
Aha, that gives me the names 'mydb' and 'mydb_log', but there's nothing returned to report the path. Could I get this from the ID's ?
S.
BTW, I need to get this programmatically, via SQL statements rather than by using Entreprise manager.
April 29, 2005 at 6:41 am
Didn't you have the column filename, containing the full path?
April 29, 2005 at 6:47 am
OMG, how silly !! I executed the command in Query Analyser, and it reported the results back in a table. The 'filename' column was off the right of the screen, and I didn't notice it !!!! Many thanks, that's just what I need.
S.
April 29, 2005 at 6:50 am
You will get following fields
fileid groupid size maxsize growth status perf name filename
Move your scrollbar and check it out
April 29, 2005 at 7:36 am
Hehe, exactly what I guessed but I thought I'd let you find it yourself.
April 29, 2005 at 11:23 pm
The following will also serve your purpose
use <database_name>
go
sp_helpfile
go
--------------------
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply