Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everyone,
Can anyone tell me how can I execute sql statements in Readonly mode so that delete command cannot be executed.
Write now I have made a new user with ReadOnly permissions but I herd that there is some way via which we can execute our statements in ReadOnly mode without making a new user.
So is there anyone who is aware of the same.

Thanks
Posted

1 solution

Yes it is possible. Try the following command

//Make read only

ALTER DATABASE database-name SET READ_ONLY

//Back to read write

ALTER DATABASE database-name SET READ_WRITE
 
Share this answer
 
Comments
[no name] 20-May-11 6:23am    
Thanks a lot sir :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900