View logical log filename and physical location for MS SQL database files

View logical log filename and physical location (current DB only).
select physical_name from sys.database_files where type = 1

View logical log filename for all DBs:

select a.name, b.name as 'Logical filename', b.filename from sys.sysdatabases a
inner join sys.sysaltfiles b
on a.dbid = b.dbid where fileid = 2

One thought on “View logical log filename and physical location for MS SQL database files”

Leave a Reply

Your email address will not be published. Required fields are marked *