Avatar of arturosm
arturosm
 asked on

MS SQL Server 2008 Restart command

Hello.

I need to call a command or API function to stop and then restart SQL Server 2008 each other day. Before, I had MSSQL Server 2000 and used the following commands from within my program:

net stop SQLServerAgent
net stop MSSQLServer

then

net start MSSQLServer
net start SQLServerAgent

But with SQL Server 2008 they don´t work, it seems the services are named different than in previous versions (for example the SQL 2000 version).

Note:

I'm using SQL Server 2008 Express Edition for the testing and I'm not sure if the service is called the same in the "regular" (not Express) edition.

Any idea how to do this ?

Regards.
Microsoft SQL Server 2008Microsoft SQL Server

Avatar of undefined
Last Comment
Michael Ortega

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Michael Ortega

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
arturosm

ASKER
Thanks a lot.
Michael Ortega

My pleasure.

MO
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes