Re: How to close all concurrent connections to a database?

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 11/11/04


Date: Wed, 10 Nov 2004 22:13:53 -0600

Hi,

You can execute:

ALTER DATABASE MyDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE

and after the task u can set the database to multi user

ALTER DATABASE MyDatabase SET MULTI_USER

-- 
Thanks
Hari
SQL Server MVP
"Le Hoang Anh" <mr_khas@yahoo.com> wrote in message 
news:uDKfdv5xEHA.3624@TK2MSFTNGP09.phx.gbl...
> Hi all,
> I'm wondering how to detect and close all concurent connection to a 
> database in SQL Server 2000. Could anyone give me a solution, plz?
> Thanks!
> 


Relevant Pages

  • Re: SQL Server 2005, XML xquery and ADO.net 2.0 ARITHABORT Error
    ... Connect to your SQL Server instance using Query Analyzer ... alter database mydatabase set arithabort on ...
    (microsoft.public.sqlserver.xml)
  • Re: Setting Database Access
    ... ALTER DATABASE MyDatabase ... Most good judgment comes from experience. ... instances of SQL Server 2000 on the same server. ... set the database access on the other instance to Read only, ...
    (microsoft.public.sqlserver.security)
  • Re: How to close all connections to do backup programmatically?
    ... ALTER DATABASE MyDatabase ... one does not normally quiesce the database to perform backups. ... Transact-SQL BACKUP DATABASE command will guarantee transactional integrity, ... SQL Server MVP ...
    (microsoft.public.sqlserver.programming)