From: tnt on
Hello,

I want to take the database offline to do a restore. It is taking forver....

Its sql 2005 enterprise sp2. I tried rebooting the server. Server is
windows 2003 enterprise.


tnt
From: Uri Dimant on
tnt

Are there any activities on the server? Kick out all users/trans

ALTER DATABASE db

SET Single_USER

WITH ROLLBACK IMMEDIATE;



ALTER DATABASE db

SET MULTI_USER

WITH ROLLBACK IMMEDIATE;



THEN



ALTER DATABASE db SET OFFLINE



"tnt" <tnt(a)discussions.microsoft.com> wrote in message
news:D1B8F112-6850-43D8-A8A6-C11CFA14073C(a)microsoft.com...
> Hello,
>
> I want to take the database offline to do a restore. It is taking
> forver....
>
> Its sql 2005 enterprise sp2. I tried rebooting the server. Server is
> windows 2003 enterprise.
>
>
> tnt


From: Dan Guzman on
To add on to Uri's response, you can combine the operations into a single
command:

ALTER DATABASE MyDatabase
SET OFFLINE WITH ROLLBACK IMMEDIATE;

--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/


"tnt" <tnt(a)discussions.microsoft.com> wrote in message
news:D1B8F112-6850-43D8-A8A6-C11CFA14073C(a)microsoft.com...
> Hello,
>
> I want to take the database offline to do a restore. It is taking
> forver....
>
> Its sql 2005 enterprise sp2. I tried rebooting the server. Server is
> windows 2003 enterprise.
>
>
> tnt