When we try to move a SQL Express 2005 database to another folder in the same
computer or to other computer it only attach as read only.
Here is the procedure:
- Install SQL Express (I used a instance called SQL2005)
- Create or attach a database from other computer
- Detach the database (sp_detach_db)
- Copy files (mdf and ldf) to other folder
- Attach the database (sp_attach_db or create database for attach).
It will attach the database as readonly. If you try to use Alter Database to
change to read-write you receive an error.
This is only on the Express Edition. The same procedure works ok on the
developer copy download from MSDN.
The point is, I need to distribute this database to customers (they have
some data inside, so I cannot create then). I don't know what folder my
customers will use to install. And I cannot remove the readonly state of the
database.
How to solve this '
Thanks for any help.Hi
Just solved it.
The SQL Express installed with user "NetWork Service" not "LocalSystem" I
use in the other machine. I changed my command line to force LocalSystem and
it is now working.
"Gustavo Trunci" wrote:
> When we try to move a SQL Express 2005 database to another folder in the same
> computer or to other computer it only attach as read only.
> Here is the procedure:
> - Install SQL Express (I used a instance called SQL2005)
> - Create or attach a database from other computer
> - Detach the database (sp_detach_db)
> - Copy files (mdf and ldf) to other folder
> - Attach the database (sp_attach_db or create database for attach).
> It will attach the database as readonly. If you try to use Alter Database to
> change to read-write you receive an error.
> This is only on the Express Edition. The same procedure works ok on the
> developer copy download from MSDN.
> The point is, I need to distribute this database to customers (they have
> some data inside, so I cannot create then). I don't know what folder my
> customers will use to install. And I cannot remove the readonly state of the
> database.
> How to solve this '
>
> Thanks for any help.
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment