ASP.NET Tip 2. Why do I need to stop or jump your SQL Server quickly while coding with ASP.NET?


For more tips like this, LIVE and IN PERSON, come see us at the MSDN Roadshow !

.NYC

↑ Grab this Headline Animator

Many times you’ll be working with a SQL Server database when you are writing ASP.NET code. There will be times (often for me) where you will need to stop or jump your server. Here are some reasons why you’d want to do this, and a tip to show you how to do it really quickly. This is great for people who hate using the mouse.

Why should I stop SQL Server in the middle of programming?

The number one reason is for when you are performing a backup. I back up almost every day. You’ll need to stop the SQL Server service in order to do so.

Why should I jump SQL Server in the middle of programming?

You may need to jump it because you wrote some leaky code (not going to incriminate myself) and want to refresh your connections and freshen up your memory allocation.  Open up your Task Manager from time to time to check how your memory is doing with SQL Server. Sometimes a quick jump as you are debugging a tricky problem, helps speed things along.

How do I quick start SQL Server?

One of the fastest ways I find to stop SQL Server from running is with a quick volley of keystrokes (rather than going into SQL Server Management Studio or into Windows Services). You can also toss this into Notepad and run it as a batch file instead. 

  1. Hit Windows key + R. This will pop-up the Run dialog box
  2. Type in net stop mssqlserver                           image
  3. When you are ready to start the service again, type net start mssqlserver

Both steps will cause a command window to open indicating progress.

image

For Vista users you can also use accelerator keys if you do not have a Windows key on your keyboard. Replace step 1 with:

  1. Hit CTRL+ESC or the Windows key
  2. Type  R – this will bring up the Run command

Where is my Run dialog box?

For those of you running Windows7, the Run command isn’t available from your Start menu by default. You can turn it on:

  1. Right click on your Start icon (that’s the Windows Logo in the bottom left corner of your screen)
  2. Select Properties
  3. Chose the Start Menu tab
  4. Click the Customize button
  5. Scroll down until you see the “Run command” check box.
  6. Check it.
  7. Click Ok.

image

Technorati Tags: ,

Skip to main content