select a.[name],b.physical_name from sys.databases a , sys.master_files b
where a.database_id= b.database_id
and b.physical_name =‘d:\db\host3291828.mdf‘
根据数据库文件,查找对应的数据库
以后应该详细了解数据库系统表的各个信息!
根据数据库文件,查找对应的数据库
原文:http://www.cnblogs.com/davytitan/p/4177488.html