Results 1 to 2 of 2

Thread: set particular_user with rollback instant

  1. #1
    HowardAllen is offline Senior Member
    Join Date
    Dec 2009
    Posts
    196
    Rep Power
    3

    Default set particular_user with rollback instant

    I am DBA in MNC.I want to set single user with rollback in SQL server database but the problem with me is that it is hanging up with spid-2.Any help would be appreciated. Thanks in advanced.

  2. #2
    MyersGray is offline Senior Member
    Join Date
    Dec 2009
    Posts
    197
    Rep Power
    3

    Default

    For disconnecting all the non admin I use the following codes:

    ALTER DATABASE folder SET limited_USER WITH ROLLBACK IMMEDIATE

    To restore the database. I want to boot developers in which Alter database statement just works on non admins.

    Code:
    DECLARE @spid varchar(10)
    SELECT @spid = spid
    FROM master.sys.sysprocesses
    WHERE dbid IN (DB_ID('Database1'), DB_ID('Database2'))
    WHILE @@ROWCOUNT <> 0
    BEGIN
     EXEC('KILL ' + @spid)
     SELECT @spid = spid
     FROM master.sys.sysprocesses
     WHERE
      dbid IN (DB_ID('Database1'), DB_ID('Database2')) AND
      spid > @spid
    END

Similar Threads

  1. Instant Highlighter - 2.6.1.1
    By joshin in forum Download Tools and Softwares
    Replies: 0
    Last Post: 04-07-2010, 10:23 AM
  2. Managing Rollback segment in database
    By GonzalezBrown in forum Programming
    Replies: 2
    Last Post: 02-09-2010, 05:39 PM
  3. IM (Instant Messaging)
    By lynette in forum Everything Else
    Replies: 0
    Last Post: 03-23-2009, 12:03 PM
  4. Instant Messenging
    By joshin in forum General Internet Terms
    Replies: 0
    Last Post: 01-22-2009, 11:36 AM
  5. Creative Instant Web Cam
    By rihan254 in forum Everything Else
    Replies: 0
    Last Post: 10-13-2008, 08:34 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48