make the database unavailable while loading it

make the database unavailable while loading it

am 16.07.2007 18:56:45 von rshivaraman

Hi All:

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

Thank you
RS

Re: make the database unavailable while loading it

am 17.07.2007 00:16:22 von Erland Sommarskog

(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/downlo ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx