Deleting .MDF File

  • Hello All,

    I've got a file named DATA.mdf that I'm not sure is being used or not. Is there a DMV I can query to see every MDF file being used by SQL Server 2005?

    I got the idea to try and attach it to see what it is, but when I try to locate the file in SSMS while trying to attach, SQL Server can't see that file. I can see my other MDF files though, so I'm a bit baffled.

    Any ideas on seeing if SQL Server needs this file?

    Thanks!

  • sys.master_files should give you a system wide catalogue of data and log files being used.

  • Great, thank you very much. The file was not in the list generated by:

    select physical_name from sys.master_files So, I went ahead and renamed the file and restarted the MSSQL service. Everything came up as expected. Only then did I delete the file without issue. Thank you for the help!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply