Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Physical Database and Log File location

How do I get the Physical Database and Log File location (file system path) of a DB in SQL Server 2005?

I used this to get the mdf file: {SELECT [Name], FileName FROM sysdatabases} but need to get the log file as well...

Cheers, Conor

like image 434
Conor Avatar asked Feb 13 '26 12:02

Conor


2 Answers

SELECT * FROM sys.database_files

like image 70
Will A Avatar answered Feb 17 '26 09:02

Will A


Here is another way

select * from sys.sysaltfiles
like image 42
SQLMenace Avatar answered Feb 17 '26 08:02

SQLMenace



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!