Posts

Showing posts from October, 2015

Start and Stop SQL Server from Windows Command Line or File

Seeing as how I was given a regular workstation rather than a developer's workstation at my new job, RAM is at a premium. It's amazing what you can still accomplish with 4 GB but you have to be judicious in its use. Towards that end, I'm running the local instance of SQL Server on an as-needed basis. Rather than opening Services from the Windows Start menu's "Administrative Tools" item, I created two cmd files (and, yes, I should've used PowerShell): one to start the database engine instance and a second to stop the database engine instance. StartSql.cmd NET START MSSQL$SQLEXPRESS2008R2 SET /p DUMMY=Hit ENTER to continue... StopSql.cmd NET STOP MSSQL$SQLEXPRESS2008R2 SET /p DUMMY=Hit ENTER to continue... Once I had the cmd files done, I went into Services and updated the SQL Server service for that instance so that it was manually started rather than automatically started. Finally, I placed a shortcut for each cmd file on my desktop. Now, wh