I have changed one of the databases to read-only in SQL Server 2005. I would like to track if someone tries to write to the database.

Any suggestions on how to track such requests (end user write request failures)?

1 Answer 1


A readonly database is "READ_ONLY". No writes are allowed - the application will get an error stating that the database is readonly.

You can run a server side trace (since you are stuck with sql server 2005) and look for user error messages and filter your database by ID.

  • Thanks Kin. I would like to keep the database in read-only mode for few weeks. Running trace may not be a viable option. Is there any way (ex: Trace Flag) so I can trace it in error logs? My intention is to find if any application is trying to change the data in this database.
    – Vijred
    Nov 24, 2015 at 17:48
  • @Vijred I dont think any trace flag can record this and using Trace flag for things like this is not a good idea. I would suggest you to look into server side trace - check this out that I use for server migrations. This will tell you what applications/hostnames are connecting to your database. You can adjust the script as per your needs.
    – Kin Shah
    Nov 24, 2015 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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