title: Any way to quickly tell which database, if any, is attached to a .mdf file?
body: <p>Assume SQL Server 2005 / 2008 with a large number of databases.  Is there any way to quickly tell which database, if any, is attached to a particular .mdf file?  </p>
  
  <p>We've dropped some databases over time and would like to clean up some lingering .mdf's to clear up space on the server.  Currently the only way I know of is to look at the properties of each database, one by one, in Management Studio and make a list of the files they're attached to.  Looking for something a little more efficient than this, if anything exists.</p>