Results 1 to 2 of 2

Thread: kicking people out of a Database 4 no activity

  1. #1
    Join Date
    Feb 2007
    Posts
    3

    kicking people out of a Database 4 no activity

    Is there a way to kick users out of your databases if there's no activity for a certain duration of time. For example, I have a database thats being shared by 5 people. One went to lunch and locked their office just when I needed to do maintanence. I had to wait for them to get back & logout be fore I could do anything?

  2. #2
    Join Date
    Sep 2005
    Posts
    168
    --kick all users
    ALTER DATABASE nameofdatabase
    SET SINGLE_USER WITH <option>

    <option>:
    ROLLBACK AFTER integer (seconds)
    ROLLBACK IMMEDIATE
    NO_WAIT
    GO

    --restore to mulituser
    ALTER DATABASE nameofdatabase
    SET MULTI_USER WITH NO_WAIT

    GO

    --HTH--

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •