Showing posts with label Keyboard Shortcuts. Show all posts
Showing posts with label Keyboard Shortcuts. Show all posts

Friday, January 6, 2017

SQL Server - Adding IF, BEGIN/END, WHILE statement easily to the code

Do you know that you can add, specifically surround your code with BEGIN/END, IF, and WHILE statements using a menu item without writing them? Yes, with Management Studio, it is possible. Here are the steps for doing it;

Assume that you have the below code that needs to be repeated based on a condition;


All you have to do is, select the code needs to be surrounded and press Ctrl+K and Ctrl+S (Just press Ctrl and hold, and press K first and then S). This is what happen when you do it;


Select WHILE and press Tab key. This is what you should see;


Set the condition as you need now. This shortcut can be opened using the context menu as well.

Monday, December 12, 2016

Inserting NULL to cells when editing rows

This is not something new but many are unaware this. If you want to insert a NULL to one of the cells when editing records using Management Studio Edit, what is the short-cut key can be used?

If you need to set NULL to a cell, you can press CTRL+0 for adding NULL.


In addition to that, you can use following combinations during Edit-Mode for opening relevant windows.



Sunday, January 12, 2014

SQL Server Management Studio – Five ways of executing a code

How many ways you have used for executing a T-SQL code in Management Studio? I am sure you have used two well-known options but other three options are unknown to many. Here are all five ways;

  1. Clicking Execute button in SQL Editor toolbar.
  2. Pressing F5 key in keuboard.
  3. Pressing CTRL+E shortcut key.
  4. Pressing CTRL+SHIFT+E shortcut key.
  5. Pressing ALT+X shortcut key.