Home All Groups Group Topic Archive Search About

Disconnect Client Connection via T-SQL/Store Proce

Author
10 Feb 2006 10:49 AM
Curtis Kam
Hi Gents,

If there are some client connections on the database and I would like to
detach the file, it's failed when execute the store proc "sp_detach_db". Any
SQL statement or Store Procedure on clearing/kicking out the current client
connections? Thanks in advance.

Regards,
CurtisL

Author
10 Feb 2006 10:54 AM
markc600
You can use the KILL command.
Are all your drivers up to date? click for free checkup

Author
10 Feb 2006 11:14 AM
Enric
Moreover, using kill <id> with statusonly. So this way I can see the rollback
progression out of danger.

Show quoteHide quote
"markc***@hotmail.com" wrote:

>
> You can use the KILL command.
>
>
Author
10 Feb 2006 10:55 AM
Enric
ALTER DATABASE <bd> SET SINGLE_USER with rollback immediate
and then
ALTER DATABASE <bd> Set MULTI_USER
Author
13 Feb 2006 2:27 AM
Curtis Kam
Got it, thanks.

Show quoteHide quote
"Enric" <En***@discussions.microsoft.com> wrote in message
news:E1D27BFF-57E1-4DEC-8D29-D9DF90A799DD@microsoft.com...
>
> ALTER DATABASE <bd> SET SINGLE_USER with rollback immediate
> and then
> ALTER DATABASE <bd> Set MULTI_USER
>

Bookmark and Share