0

I need to be able to lock a SQL database while a set of end of day stored procedures are running within a SQL server agent job.

This needs to happen so that a series of checks that occur at the end of day aren't affected by new data. The checks happen in a bottom up approach and new data would result in checksums failing as we went up the tree.

Please let me know if more information is needed.

Damian Jacobs
  • 488
  • 6
  • 21
  • 2
    Have you looked at setting the database to single user mode? – Jason Goemaat May 19 '20 at 14:10
  • My understanding of SQL is poor so sorry if my understanding of your suggestion is incorrect. As it stands we have multiple AWS lambdas querying and writing to the database throughout the day so limiting the number of users to one, may result in certain aspects of the project not working if they can't gain access to the database. – Damian Jacobs May 19 '20 at 14:45
  • So you want the database to remain available for read access, just prohibit writing? Does 'ALTER DATABASE MyDatabase SET READ_ONLY` sound ok? – Jason Goemaat May 19 '20 at 19:50

0 Answers0