Loading

Thursday, August 20, 2009

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

1 comment:

  1. This is great. Helped me a ton. Thanks.

    ReplyDelete