Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have set up Transaction Replication and its working well.

I have a few different web apps that connect to the publisher and subscriber database and I am concerned that if they use the subscriber database for inserting/updating/deleting intentionally, or accidentally data will be lost. (it should essentially be used as a read-only database because I have not setup updatable subscriptions).

I tried changing the database properties to be read-only, but this caused the replication to fail.

I was thinking maybe a before and after script during replication to add/remove the database read-only flag?

Is there a better way to do this?

share|improve this question
up vote 1 down vote accepted

Instead of altering the database to become read only, create a new login and add it to the db_datareader role of the subscriber database.

share|improve this answer
Thanks Alexis, that should do the trick. – duyker May 30 '12 at 23:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.