Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Kill

Author  Topic 

victord
Yak Posting Veteran

64 Posts

Posted - 2005-08-10 : 09:58:04
Hello,

I have been using sql server as an administrator for about 3yrs now,but have not yet mastered a way to have exclusive access when i want to do some admin jobs i.e restore,i know i can go into enterprise manager and right click the database and go to properties to restrict access to myself(Admin).

Each time i have to do this 3 or 4 times, while at the same kiling user processes within current activity in Ent Mng. After maybe the 4th time then i have exclusive acces and sometimes it doesn't even work at all.

Cheers

does any one no a better way to do this.

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-08-10 : 10:15:41
This should do it:

ALTER DATABASE MyDB
SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE




CODO ERGO SUM
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-08-10 : 10:18:12
ALTER DATABASE <dbname> SET SINGLE_USER WITH ROLLBACK IMMEDIATE

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -