Posted by Erland Sommarskog on 07/16/07 22:16
(rshivaraman@gmail.com) writes:
> I need to make my database unavailable when i am loading the db. This
> happens daily and the db is not connected to any online app, to make
> the app unavailable. It is queried thru an Access and hence available
> all the time.
> The load happens daily for an hour in the morning.
> Is there anyway to make it inaccessible to users while loading data
> and then make it accessible
The process that runs the load could issue ALTER DATABASE SET SINGLE_USER
when it starts and ALTER DATABASE SET MULTI_USER when it's done. You may
be interested in adding WITH ROLLBACK IMMEDIATE to the single-user command.
See Books Online for details.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|