I have a database file .mdf
from MS SQL EXPRESS in folder:
C:\\Program Files\\Microsoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA
Here is what happened in my case. I was asked to attach files for a database. I was given the file names as follows
I proceeded to attach the files and kept getting the files are in use by another process.
I ran a query against the system view select name, physical_name from sys.master_files; and saw that the exact file names were already in use by another database, thus each time I tried to attach the files, I kept getting the error the files are in use by another process(sql server)
Thus if you are getting such a message, then also query against the system view sys.master_files and see which database may already be using the same name files. Hereafter you will figure out what to do.
thanks.