Dropping an active connection on an attached database

Why in the hell doesn't SQL Server provide a facility for dropping an
active connection on an attached database in SQL Server Management
console? I can't detach an attached database because apparently there
is an active connection.

I know you can use SSEUTIL but it seems like kluge for a poorly
thought out function.

Crazy
danbredy [ Mi, 09 Januar 2008 19:42 ] [ ID #1903550 ]

Re: Dropping an active connection on an attached database

Crazy Cat (danbredy [at] hotmail.com) writes:
> Why in the hell doesn't SQL Server provide a facility for dropping an
> active connection on an attached database in SQL Server Management
> console? I can't detach an attached database because apparently there
> is an active connection.

ALTER DATABASE db SET SINGLE_USER WITH ROLLBACK IMMEDIATE


--
Erland Sommarskog, SQL Server MVP, esquel [at] sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downlo ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx
Erland Sommarskog [ Mi, 09 Januar 2008 23:40 ] [ ID #1903556 ]

Re: Dropping an active connection on an attached database

On Jan 9, 5:40 pm, Erland Sommarskog <esq... [at] sommarskog.se> wrote:
> Crazy Cat (danbr... [at] hotmail.com) writes:
> > Why in the hell doesn't SQL Server provide a facility for dropping an
> > active connection on an attached database in SQL Server Management
> > console? I can't detach an attached database because apparently there
> > is an active connection.
>
> ALTER DATABASE db SET SINGLE_USER WITH ROLLBACK IMMEDIATE
>
> --
> Erland Sommarskog, SQL Server MVP, esq... [at] sommarskog.se
>
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/down loads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/boo ks.mspx

Thanks Erland, I'll give it a try.

You are the man!

Crazy
danbredy [ Di, 15 Januar 2008 15:46 ] [ ID #1908240 ]
Datenbanken » comp.databases.ms-sqlserver » Dropping an active connection on an attached database

Vorheriges Thema: SQL 2005: Transactional Replication > Executing sp on subscriber
Nächstes Thema: SQLServerException: The TDS prelogin response is incomplete.