Re: How to close all connections to do backup programmatically?
From: Dan Guzman (guzmanda_at_nospam-online.sbcglobal.net)
Date: 11/11/04
- Next message: Michael Cheng [MSFT]: "Re: xp_sendmail @subject Problem"
- Previous message: Mark: "Converting Exists and NOT EXISTS into UDF or a View etc.."
- In reply to: Trieu Anh Dung: "How to close all connections to do backup programmatically?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Nov 2004 21:43:51 -0600
You can execute:
ALTER DATABASE MyDatabase
SET RESTRICTED_USER
WITH ROLLBACK IMMEDIATE
and
ALTER DATABASE MyDatabase
SET MULTI_USER
afterward.
However, one does not normally quiesce the database to perform backups. A
Transact-SQL BACKUP DATABASE command will guarantee transactional integrity,
even if you have active users.
-- Hope this helps. Dan Guzman SQL Server MVP "Trieu Anh Dung" <dungniit@yahoo.com> wrote in message news:Ol1xH75xEHA.4044@tk2msftngp13.phx.gbl... > Hi all, > I'm using SQL Server 2K on Win2K to develop a window-based application > using > .NET framework. Now I have to implement a function that query database and > make backups, I want to close all concurrent connection on SQL Server > before > running the backup process. Please help me! > Thanks for reading! > > TrieuAnhDung > >
- Next message: Michael Cheng [MSFT]: "Re: xp_sendmail @subject Problem"
- Previous message: Mark: "Converting Exists and NOT EXISTS into UDF or a View etc.."
- In reply to: Trieu Anh Dung: "How to close all connections to do backup programmatically?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|