Hi, I need some help.
I've been trying to detach my SQL Server 2005 Express database so as
to attach it to my remote server. This has worked in the past, but I
can't get it to work this time - it attaches to the remote server as
read-only. However, then suddenly it would no longer attach back to
the local server, with a new error message and so I was left with no
database at all! This new error now comes when trying to attach to
either the remote or local server.
Basically somehow, when reattaching, it started taking the wrong paths
from the file - i.e. even though I pressed add and selected the mdf
file, it then put the wrong paths, and so couldn't find the files.
The error message was along the lines of, 'The directory 'C:\etc'
cannot be found'. But then it started working properly again, so I
got my database back.
However, I'm now highly concerned about doing anything, so I have a
couple of questions:
- When I lost the database, I tried to restore a backup I had made,
but I couldn't because the database wasn't present to restore to
(because it was detached). Is there a way to restore a database
without the database being there?
- The original problem I was experiencing was the database attaching
to the remote server as read-only. Any ideas as to why this is? I
tried going into Properties > Options and setting Read-Only to false,
but got the error message, 'Unable to open the physical file 'E:
\etc'.
Option 1: I created a backup of the database called database.bak.
However I can't seem to attach it restore it unless the database is
there to restore it too (which I don't have, as it won't reattach).
Is there a way to do this?