Click here to Skip to main content
14,636,132 members
Rate this:
Please Sign up or sign in to vote.
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100