June 1, 2011 at 10:25 am
I have some log files that haven't been modified in quite some time. My question is, if I have the name of just the log file, is there a query that can return the name of the database that uses it?
sort of like
select databasename from SomeWhere
Where databaseLogFile = 'The Log File Name Goes Here'
June 1, 2011 at 10:35 am
select db_name(database_id),physical_name from sys.master_files
All the information you need is in that table. [name] is the logical file name. If you're looking for a specific filename, look in [physical_name].
June 1, 2011 at 10:37 am
Keep in mind that dbs can be dettached so before deleting something make REALLLLLLLLLLY sure it's not needed anymore... and even then burn it cd/dvd if possible.
June 1, 2011 at 10:45 am
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply