Re: Restart Services

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Keith Kratochvil (sqlguy.back2u_at_comcast.net)
Date: 08/11/04


Date: Wed, 11 Aug 2004 12:05:27 -0500

Create a startup procedure that will email you when the server starts. You
will need to mark it to run on startup.

exec sp_procoption 'The_stored_procedure_to_run_on_startup, 'startup',
'true'

-- 
Keith
"tram" <tram_e@hotmail.com> wrote in message
news:26ee1067.0408110852.6b537c35@posting.google.com...
> Vyas,
>
> How do we setup mail notification (alert) when sql server restarts
> after stopping? We were getting stop alert, but not when it comes back
> UP. Any suggestions would be apprecitaed.
>
> Thanks
>
>
>
>
> "Narayana Vyas Kondreddi" <answer_me@hotmail.com> wrote in message
news:<ezYubnkdEHA.228@TK2MSFTNGP11.phx.gbl>...
> > How to restart SQL Server at regular intervals?
> > http://vyaskn.tripod.com/restart_sql_server_service.htm
> > -- 
> > HTH,
> > Vyas, MVP (SQL Server)
> > http://vyaskn.tripod.com/
> >
> >
> > "Noor" <noor@ngsol.com> wrote in message
> > news:OsvN9UfdEHA.3616@TK2MSFTNGP10.phx.gbl...
> > Thanks Hari and Keith...
> >
> > Noor
> >
> > "Hari Prasad" <hari_prasad_k@hotmail.com> wrote in message
> > news:uIyaaVYdEHA.2352@TK2MSFTNGP09.phx.gbl...
> > > Hi Noor,
> > >
> > > I agree with Keith, Put the below contents in a batch file:-
> > >
> > > NET STOP SQLSERVERAGENT
> > > NET STOP MSSQLSERVER
> > > NET START MSSQLSERVER
> > > NET START SQLSERVERAGENT
> > >
> > > After that schedule this batch using the Windows scheduler or use the
AT
> > > command.
> > >
> > > See the help of AT command by executing the below from command
prompt:-
> > >
> > > AT/?
> > >
> > >
> > > Note: Ensure that Task schedular service is running all the time. AT
> >  comand
> > > and Windows schedular user this service.
> > >
> > > Thanks
> > > Hari
> > > MCDBA
> > >
> > >
> > > "Keith Kratochvil" <sqlguy.back2u@comcast.net> wrote in message
> > > news:erWb75WdEHA.3528@TK2MSFTNGP12.phx.gbl...
> > > > Do you want to stop the services so that you can backup your
databases?
> > > > Perhaps you could use the Transact-SQL BACKUP command to backup your
> > > > databases to disk that you could then backup using your backup
software.
> > > >
> > > > If you don't have the available disk space to backup the databases
and
> >  you
> > > > can afford some downtime probably the better option is to issue
> > > > sp_detach_db, then have the backup software backup your databases,
and
> >  then
> > > > issue sp_attach_db.
> > > >
> > > >
> > > > If you want to stop SQL Server from a job you could try creating a
batch
> > > > file that issues the appropriate NET STOP and NET START commands.
You
> >  can
> > > > then schedule a job to call the batch file.  I have not tried this,
so I
> > > > don't know if it will work or not, but that is one way you could do
it
> > > > within a [SQL] job.  If the SQL Server job does not work you could
also
> > > > schedule a job within NT to call the batch file.
> > > >
> > > > --
> > > > Keith
> > > >
> > > >
> > > > "Noor" <noor@ngsol.com> wrote in message
> > > > news:O6M1c4TdEHA.1656@TK2MSFTNGP09.phx.gbl...
> > > > > Dear Professional
> > > > >
> > > > > I want to restart the msSqlServer and msSqlAgent Services once a
day
> >  through
> > > > > JOB, how can I perform this
> > > > >
> > > > > Thanks
> > > > > NOOR
> > > > >
> > > > >
> > > >
> > >
> > >


Relevant Pages

  • Re: C# exe calling an exe (process.start) - not working on one ser
    ... I am not familier with how to add ... >> Since it is a production server, I cannot debug the code there and I am ... >> I have this C# program set up on the windows scheduler and it is running ... > Add logging. ...
    (microsoft.public.dotnet.general)
  • Logging into a network dirve
    ... I have an application that will run - using the windows scheduler - in the ... The problem is the computer is sitting at the ... login prompt when the application tries to connect to the server. ...
    (borland.public.delphi.language.objectpascal)
  • Re: need to launch an .asp page automatically
    ... He don't have acces to the server. ... >> I would like to run an ASP page each day at the same time automatically. ... > Windows Scheduler. ... > using SQL Server, you can use a job with SQL Agent. ...
    (microsoft.public.inetserver.asp.general)
  • Re: dcdiag - advertising errors on newley promoted domain controller
    ... Can you do the following on uksccmads01 ... The problem may actually have nothing to do with the new server but the ... From a command prompt try and see if you get any additional info ... Skipping site UK-CCM, this site is outside the scope ...
    (microsoft.public.windows.server.active_directory)
  • Re: dcdiag - advertising errors on newley promoted domain controller
    ... Can you do the following on uksccmads01 ... The problem may actually have nothing to do with the new server but the ... Active Directory Forest Replication GUIDs Found: ... From a command prompt try and see if you get any additional info ...
    (microsoft.public.windows.server.active_directory)