Dan,
I am having the exact same problem. I loaded a utility from
www.sysinternals.com that told me that it is indeed the SQL Server process
locking the .mdf file. I, however, have been unable to correct the problem.
I'm thinking about stopping the SQL Server, renaming the .mdf files,
restarting the server, then attaching the DBs.
I believe I locked the DB file accidentally before I detached by issuing a
DBCC OpenTran(<DBName>). Now I can't reattach because of the file lock.
Leslie
[quoted text, click to view] "Dan Slaby" wrote:
> I detached a database and moved it to another folder. I am trying to
> re-attach the database and am getting 'Error 5123: CREATE FILE encountered
> operating system error 32(The process cannot access the file because it is
> being used by another process.) while attempting to open or create the
> physical file...
>
> Is there a file configuration setting I can change to eliminate this error
> message? I've done this many times without problem and had no indication of
> any process using this database when I detached it. Any helpful suggestions
> to be able to attach this database will be appreciated. Thank you.
>
> Dan
>
>