Friday, February 10, 2012

clearing connection with SQLDMO

Hello, I use VS.NET and SQLDMO to do some administrative tasks.
I need to restore a database, but in some case some connections remains in
my soft even after closing them. This prevent restoration of the database.
I want to clear these connection, so I need to do the same thing that the
clear button do in the detach database window (in enterprise
manager/databases/.../all task/detach database)
SylvainKILL <spid>
David Portas
SQL Server MVP
--
"Sylvain Provencher" <sylvain.provencher@.nobelia.com> wrote in message
news:OV5oCYHxFHA.908@.tk2msftngp13.phx.gbl...
> Hello, I use VS.NET and SQLDMO to do some administrative tasks.
> I need to restore a database, but in some case some connections remains in
> my soft even after closing them. This prevent restoration of the database.
> I want to clear these connection, so I need to do the same thing that the
> clear button do in the detach database window (in enterprise
> manager/databases/.../all task/detach database)
> Sylvain
>|||Yes, but how can I get list of process to know which to kill ?
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:Lu2dnd1AebDajabeRVnygg@.giganews.com...
> KILL <spid>
> --
> David Portas
> SQL Server MVP
> --
>
> "Sylvain Provencher" <sylvain.provencher@.nobelia.com> wrote in message
> news:OV5oCYHxFHA.908@.tk2msftngp13.phx.gbl...
>|||I found sp_who to get this info
"Sylvain Provencher" <sylvain.provencher@.nobelia.com> wrote in message
news:%23p$MdQPxFHA.3856@.tk2msftngp13.phx.gbl...
> Yes, but how can I get list of process to know which to kill ?

No comments:

Post a Comment