Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 Changing database to read/write

Author  Topic 

malek.safa
Starting Member

5 Posts

Posted - 2010-08-24 : 04:18:01
hello, my database is read only so i can't execute update or delete on it, how can i change it to read/write?

do i have to give privileges for users using it? or should i change the property of the database file?

thx

malek.safa
Starting Member

5 Posts

Posted - 2010-08-24 : 05:27:37
okay i have managed to do it by changing the security settings of the file .mdf and allow USERS to modify, but my question now is if i want to give some certain users priveleges to write and all other users to read, i have tried to add that particular user into the security setting and gave him write priveleges but that haven't worked.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-24 : 06:40:10
You can use db_datareader database role for read-only access and db_datawriter database role for write-only access. You can combine them for read/write access.

Setting a database to read-only is typically done at the database level and not at the NTFS level (file level).

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

malek.safa
Starting Member

5 Posts

Posted - 2010-08-24 : 07:14:08
and how to i grant these roles? should i create them or they already exist in sql express?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-24 : 07:14:56
They already exist. You can grant them via the SSMS GUI. Add the logins and go to the users page, and you'll see them in the roles section.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -