Do you mean taking a database offline or the server?
For a database, you would need to run sp_dboption; this could be scheduled
using SQL Agent.
For a server, things are more complicated since SQL Agent needs access to
the msdb database. For this I would suggest use of SQL-DMO from vbscript
scheduled using the Windows Task Scheduler or the at command depending on
what is available to you. A simpler way - particularly if vbscript is not
part of your skill; set - is to use net stop and net start from a batch
script.
Charles
> -----Original Message-----
> From: [Email Address Removed] [SMTP:[Email Address Removed] Sent: Tuesday, June 18, 2002 8:02 PM
> To: [Email Address Removed] Subject: Automation to take database offline on a scheduled basis
>
> Hello,
>
> Since I didn't see a reply to my earlier inquiry about timeout after
> database shrinkage, I guess noone had a similar problem before and be
> able
> to help. I hope that you can help me with this. Is there a way I can
> take
> the database offline and bringing it back up on a scheduled basis through
> automation instead of manual effort? If there is, please provide
> guidance.
> Thank you.
>
>
> T. T. Nguyen
> Web Applications Developer
> Journal Interactive
> Phone:414.223.5216
> Email:[Email Address Removed]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: mssqldba-[Email Address Removed] For additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page