Locking out a database for development

  • What is the simplest ay to lock a database? For examle, I want prohibit users from accessing the database, however, I (sysadmin) need to perform development activities (structure changes, etc.)--stopping SQL server / taking a database offline do not work since they prevent any access to the database. 

  • with dbo use only

     

  • I may be over-simplfying the issue- so with that said, why not remove the user's, or role's, access to the specific db itself?  And if you need to turn that ability on/off, that can easily be scripted.

    One note:  The first answer is a great suggestion, just don't forget you may have individuals in the db_owner fixed role.

  • You could put the database in single-user or restricted-user mode using database options (see BOL, Database Options and find State Options to see which would work best for your situation).

    Don

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply