SQL Server Community Blogs

Voices of the SQL Server Community
Welcome to SQL Server Community Blogs Sign in | Join | Help
in Search

Jorg Klein's Microsoft Business Intelligence Blog [Macaw]

Start / Stop SQL Server, SSIS, SSAS, SSRS and SQL Server Agent at once with a batch file

A lot of developers have SQL Server and its different services running on their PC or notebook to develop or test BI solutions. Unfortunately this slows down your system quite a lot. To speed things up when not using SQL Server, I used to stop and start each service manual quite often.

Recently I found out that it's possible to start and stop all services at once with a simple batch file. It now only takes a couple of seconds instead of a few minutes and some annoying steps.

Copy/paste the following in a .txt file and rename it to .bat to make it a batch file, execute it by double clicking the file.

START SCRIPT:

NET START "SQL Server Agent (MsSqlServer)"
NET START "MsSqlServer"
NET START "MsSqlServerOlapService"
NET START "ReportServer"
NET START "SQL Server Integration Services"


STOP SCRIPT:

NET STOP "SQL Server Agent (MsSqlServer)"
NET STOP "MsSqlServer"
NET STOP "MsSqlServerOlapService"
NET STOP "ReportServer"
NET STOP "SQL Server Integration Services"

 

Comments

 

Miky Schreiber said:

I written about it in my blogs few months ago. One more tip that I thought about - you can execute this batch file in the end of your ETL process if you'd like. It can give a little break to the SQL Server services and anyway there's a new data to be cached.

January 6, 2009 9:00 PM
 

jdiderik said:

Hi Jorg,

A small note, please make sure you stop them in the correct order (due to dependencys) and start them in reverse order.

At least don't start the Agent before the Server is started.

Starting would be in the order:

SQL Server

SQL Server Integration

SQL Server Agent

SQL Server Reporting

SQL Server Analysis

SQL Server FullText Search

And stopping should ofcourse be in reverse order!

January 7, 2009 11:57 AM
 

jorg said:

Hi jdiderik,

Thanks for your comment!

I agree that starting the agent before the server would be the correct logical order. But there are no dependencies that force you to start the server before the agent can be started.

In fact, if you start the agent SQL Server will be started automatically, so NET START "MsSqlServer" could be left out (I’ve included it just to post the command, it does no harm to execute a start SQL Server command when it’s already started).

Jorg

January 7, 2009 1:21 PM
 

jdiderik said:

That's correct, the agent would start the server.

But it's good practice to not depend on having services started by others unless this is really needed. It's harder to track down malfunctions of services if you don't check them 1-by-1. But your right, your solution is ok for the job and we're not talking production servers. It's probably a left over from my SysOp days to want to do things the structural way :-)

January 8, 2009 6:28 AM
 

Links for the week of 2009-01-09 | facility9 said:

Pingback from  Links for the week of 2009-01-09 | facility9

January 9, 2009 12:03 PM

This Blog

Syndication

News

Powered by Community Server (Commercial Edition), by Telligent Systems