19

This is not off-topic. The link to on-topic says: ...if your question generally covers...software tools commonly used by programmers...then you’re in the right place to ask your question!


I have SQL Server 2012 installed on my PC, and usually don't need it. It's only for debugging purposes.

I've seen it takes up quite some RAM so I'd like to prevent it from starting until I need it, start it, and then stop it when not needed again.

How do I do that? (I have SSMS installed as well so I can use that if that's the way to do it.)

ispiro
  • 26,556
  • 38
  • 136
  • 291
  • 1
    Check out this link (http://www.sevenforums.com/tutorials/2495-services-start-disable.html) You need to stop the SQL Server Service and set it to start manually. Then you will have to turn it on when you need it. – Taryn Jun 24 '13 at 20:14
  • 8
    You can go to "all progams->SQL Server 2012->Configuration Tools->SQL Server Configuration Manager" and change all the services StartMode to "Manual" – Lamak Jun 24 '13 at 20:15
  • Am I not right in saying that something like the following is correct? SQL Server will keep everything it can in memory until all memory is used up, so constantly eating up more and more memory as it is used. But equally it will then release memory back to the OS when other processes require it? *(In short, as your other processes use up memory, don't you see SQL Server's memory footprint reduce again?)* – MatBailie Jun 24 '13 at 20:17
  • @MatBailie When searching for a solution before posting my question - I've seen posts saying it doesn't work that well unfortunately. (See [this comment](http://serverfault.com/questions/387682/how-do-i-limit-ms-sql-server-memory-usage#comment549487_387682) for example.) – ispiro Jun 24 '13 at 20:20
  • @Lamak You can transform your comment into an answer. Definitely worth an upvote. (The answer I accepted omitted that part.) – ispiro Jun 24 '13 at 20:42
  • @ispiro thanks, but it would be an incomplete answer, and almost entirely a duplicate, no need for such an answer on SO :-) – Lamak Jun 24 '13 at 20:51

3 Answers3

20

To start, stop, pause, resume, or restart the an instance of the SQL Server Database Engine:

  1. On the Start menu, point to All Programs, point to Microsoft SQL Server 2012 , point to Configuration Tools, and then click SQL Server Configuration Manager. If the User Account Control dialog box appears, click Yes.
  2. In SQL Server Configuration Manager, in the left pane, click SQL Server Services.
  3. In the results pane, right-click SQL Server (MSSQLServer) or a named instance, and then click Start, Stop, Pause, Resume, or Restart.
  4. Click OK to close SQL Server Configuration Manager.

From: Microsoft - Start,Stop,etc. SQL Server

You can also do this from within SSMS:

In Object Explorer, connect to the instance of the Database Engine, right-click the instance of the Database Engine you want to start, and then click Start, Stop, Pause, Resume, or Restart.

Edit: As Lamak mentioned, within the SQL Server Configuration Manager you can change all the services StartMode to "Manual" so they do not start on boot.

Community
  • 1
  • 1
Hart CO
  • 34,064
  • 6
  • 48
  • 63
  • For anyone looking for the answer - The other part (-Change Auto to Manual start) is answered in Lamak's comment to the question. – ispiro Jun 24 '13 at 21:06
8

The best way is to setup se SQL service to manual, from run type “services.msc” to access windows services and change startup type to “manual” you can change all services started by SQL*.

Doing so your computer starts faster because will not start SQL Server on boot.

If you need just go again to services.msc and start the service, there's no need to change again the type they just stay "manual"

MineScript
  • 291
  • 1
  • 4
4

To stop it.

Copy:

%windir%\system32\net.exe stop mssqlserver

Windows-R

Paste

Run

To restart it, the same with:

%windir%\system32\net.exe start mssqlserver

momobo
  • 1,755
  • 1
  • 14
  • 19