SQL SERVER – CTRL + R Shortcut Does Not Work in SSMS

I just formatted my computer and installed fresh SQL Server 2014. The very first thing which I did was to open SQL Server Management Studio and execute a sample query. As soon as I executed the query, it returned me some result. Once I did not need the result, my next instinct was to hide the result as I did not need it any further. I am very used to the keyboard shortcut CTRL + R to hide the result. As soon as I typed in the CTRL + R the result pane was still visible. My pressing CTRL+R did not do anything further.

I suddenly remembered that last time when I had installed SQL Server 2012 I had faced the similar situation when a few of my shortcuts did not work. Here is what I did to make my shortcut work again.

Steps to Get Shortcut working again:

  1.  Go to Tools Menu in SSSMS
  2. Click on Option
  3. Go to Keyboard and expand the menu
  4. Click on option Keyboard again
  5. Keep the option on the drop down – Apply the following additional keyboard mapping scheme as (Default)
  6. Click on Reset

and you are done!

shortcutreset SQL SERVER   CTRL + R Shortcut Does Not Work in SSMS

Well, on the internet, there are many different solutions and many of them are valid in different scenarios. In my scenario following above steps had fixed my issue.

Reference: Pinal Dave (http://blog.SQLAuthority.com)

MySQL – Download MySQL Workbench Shortcut in PDF

shortcuts MySQL   Download MySQL Workbench Shortcut in PDFMySQL Workbench is default IDE for MySQL and it is available to download for free on MySQL’s website. It is a fully featured IDE with three major sections. 1) SQL Development 2) SQL Administration and 3) Data Modeling. Each section is quite big on its own.  There are plenty of different shortcuts to do various tasks in MySQL Workbench. I have decided to build a cheat sheet for MySQL Workbench which contains all the workbench shortcuts for the MySQL Workbench. You can print it and keep it in your work desk-wall and refer to it whenever you are using Workbench. Initially, it will be difficult to remember all the shortcuts, but as you keep on using them, you will remember the major shortcuts which you use in your daily life. This will be indeed productivity boost for your daily database tasks.

Download MySQL Workbench Shortcut in PDF

Reference: Pinal Dave (http://blog.sqlauthority.com)

SQL SERVER – Switch Between Two Parenthesis using Shortcut CTRL+]

Earlier this week I wrote a blog post about SQL SERVER – CTRL+SHIFT+] Shortcut to Select Code Between Two Parenthesis, I received quite a lot of positive feedback from readers. If you are a regular reader of the blog post, you must be aware that I appreciate the learning shared by readers.

Here is another interesting shortcut shared by another SQL Server Expert – Suvendu. He has suggested that using shortcut CTRL+] one can jump between two parenthesis in the code. This is indeed interesting. You can try it out using the following script.

FROM Sales.Currency)a)b)c

Now, move your mouse right behind b (which is highlighted).

FROM Sales.Currency)a)b)c

Now press CTRL+] and you will see that it jumps from b to the opening parenthesis.

FROM Sales.Currency)a)b)c

You can once again press CTRL+] and it will jump back to parenthesis after b.

FROM Sales.Currency)a)b)c

Small but very useful tip. Try it out and let me know if there is any other important shorcut I should highlight on the blog.

Reference: Pinal Dave (http://blog.sqlauthority.com)

SQL SERVER – CTRL+SHIFT+] Shortcut to Select Code Between Two Parenthesis

Every weekend brings creative ideas and accidents brings best unknown secrets in front of us. Just a day while working with complex SQL Server code in SSMS I came across very interesting shortcut which I have never used before and instantly fell in love with it. It is totally possible that you are familiar with this but for me it was the first time and I was surprised that I did know know this short cut so far.

Shortcut key is CTRL+SHIFT+]. This key can be very useful when dealing with multiple subqueries, CTE or query with multiple parentheses. When exercised this shortcut key it selects T-SQL code between two parentheses.

Let us see the examples to understand the same. In each of the examples I have put the cursor at the position displayed and pressed CTRL+SHIFT+] and it has selected the code between two corresponding parentheses.

Cursor position 1

cursor1 SQL SERVER   CTRL+SHIFT+] Shortcut to Select Code Between Two Parenthesis

Cursor position 2

cursor2 SQL SERVER   CTRL+SHIFT+] Shortcut to Select Code Between Two Parenthesis

Cursor position 3

cursor3 SQL SERVER   CTRL+SHIFT+] Shortcut to Select Code Between Two Parenthesis

If you are a developer and have to code with complex queries, you will totally appreciate that this feature can save so much of the time for development. I often remember my experience as a developer when I have lost a lot of hours to just balance parentheses. As I said yesterday I found this shortcut accidently. How many of you were aware of this feature? Is there any other useful feature you would like to share with us? Please leave a comment and if I have not covered it earlier, I will share it due credit on this blog.

Reference: Pinal Dave (http://blog.sqlauthority.com)

SQL Server – Switch Between Result Pan and Query Pan – SQL Shortcut

Many times when I am writing query I have to scroll the result displayed in the result set. Most of the developer uses the mouse to switch between and Query Pane and Result Pane. There are few developers who are crazy about Keyboard shortcuts.

F6 is the keyword which can be used to switch between query pane and tabs of the result pane.

By reading this small article if you have not understood what I mean to say, I suggest that you run any query in SQL Server and press F6 to see its effect. Once used you will understand the usage of it.

Reference : Pinal Dave (http://blog.SQLAuthority.com)

SQL SERVER – Query Analyzer Shortcuts – Part 2

I enjoy reader’s articles to read as much as I enjoy expert’s articles. One of blog reader Praveen Barath always have good ideas to share. Here is Praveen Barath’s comment on my previous article Query Analyzer Shortcuts.

MSSQL server 2005 is a database platform , Platform because from one window you can connect to any of MSSQL services like SSMS, SSRS,SSIS,SSAS..etc.

I am coming to your doubt why they shifted to SSMS as it s far slow.

As the matter of fact MSSQL 2005 is more graphical more user friendly and handy tool, I hope once you will aware of all SSMS functionality or new feature you might change your views, I agree it require more hardware resources like RAM, 500 MB Min, and 1000 Mb Recommended rest depends on your work load. Also I feel you would be more contented with 2000 but still there are new upcoming DBA’s which require these sort of user friendly interface.(If still you face slowness check your settings and resources.)


2000 – isqlw –To open a query analyzer in 2000

2005 – sqlwb—To open SSMS in 2005 (Not Query analyzer For New Query use Alt+N)

2005 –ssmsee—TO open SSMS in 2005 (Express Edition)

2008 – ssms – TO open SSMS in 2008

The most commonly used keyboard shortcuts in the SQL Server Management Studio (SSMS).

Run and then SqlWb.exe to launch SQL Server Management Studio

Results in Grid
Ctrl + D

Change database
Ctrl + U

Results in Text
Ctrl + T

Execute Query
Ctrl + E or F5

Show/Hide Object browser
F8 (Auto Hide has to be enabled)

New Query Window
Ctrl + Q

New Query with New Connection
Ctrl + N (Then selecting SQL Server Query template)

Open a .SQL Script file
Ctrl + O

Full Screen
Shift + Alt + Enter

Parse the query
Ctrl + F5

Show/Hide Results Pane
Ctrl + R

Switch between query and results panes

Information about all the objects in the current database
Alt + F1

Reference : Pinal Dave (http://blog.SQLAuthority.com)

SQL SERVER – 2005 – Open SSMS From Command Prompt – sqlwb.exe Example

This article is written by request and suggestion of Sr. Web Developer at my organization. Due to nature of this article most of the content are referred from Book On-Line. sqlwb command prompt utility which opens SQL Server Management Studio. sqlwb command does not run queries from command prompt. sqlcmd utility runs queries from command prompt, read for more information.

The syntax of this sqlwb is very simple. I will copy complete syntax from BOL here :
[scriptfile] [projectfile] [solutionfile]
[-S servername] [-d databasename] [-U username] [-P password]
[-E] [-nosplash] [-?]

I use following script very frequently.

1) Open SQL Server Management Studio.

2) Open SQL Server Management Studio with windows authentication with no splash screen and default database as AdventureWorks
sqlwb -E -S SQLServerName -D AdventureWorksnosplash

3) Open SQL Server Management Studio with username and password with no splash screen and default database as AdventureWorks
sqlwb -S SQLServerName -U MyUserName -P MyPassWord -D AdventureWorksnosplash

To execute above commands you should have access to sqlwb.exe file. My local computer has sqlwb file in folder : C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE
Click on Start >> click on run >> type in following command to launch SQL Server Management Studio :
“C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlwb.exe” -E -S SQL -nosplash

Reference : Pinal Dave (http://blog.SQLAuthority.com)

SQL SERVER – Download SQL Server Management Studio Keyboard Shortcuts (SSMS Shortcuts)

Download SQL Server Management Studio Keyboard Shortcuts

I have received many emails appreciating my article Query Analyzer Shortcuts and requesting same for SQL Server Management Studio Keyboard Shortcuts. I see frequent downloads of the PDF generated by SQLAuthority for the same on server. There is original article on MSDN site. I have combined complete article in one PDF again. It is easy to refer, print and manage.

Download SQL Server Management Studio Keyboard Shortcuts

Reference : Pinal Dave (http://blog.SQLAuthority.com)

SQL SERVER – Query Analyzer Short Cut to display the text of Stored Procedure

This is quick but interesting trick to display the text of Stored Procedure in the result window. Open SQL Query Analyzer >> Tools >> Customize >> Custom Tab
type sp_helptext against Ctrl+3 (or shortcut key of your choice)

Press CTRL + T to enable the text view in result window.
Type any Stored Procedure name in your database, select the SP name and type Ctrl+4.

You will see the Stored Procedure text in the Result Window.

Reference: Pinal Dave (http://www.SQLAuthority.com)

SQL SERVER – Query Analyzer Shortcuts

Download Query Analyzer Shortcuts (PDF)

Shortcut Function Shortcut Function
ALT+BREAK Cancel a query CTRL+SHIFT+F2 Clear all bookmarks
ALT+F1 Database object information CTRL+SHIFT+INSERT Insert a template
ALT+F4 Exit CTRL+SHIFT+L Make selection lowercase
CTRL+A Select all CTRL+SHIFT+M Replace template parameters
CTRL+B Move the splitter CTRL+SHIFT+P Open
CTRL+C Copy CTRL+SHIFT+R Remove comment
CTRL+D Display results in grid format CTRL+SHIFT+S Show client statistics
CTRL+Delete Delete through the end of the line CTRL+SHIFT+T Show server trace
CTRL+E Execute query CTRL+SHIFT+U Make selection uppercase
CTRL+F Find CTRL+T Display results in text format
CTRL+F2 Insert/remove bookmark CTRL+U Change database
CTRL+F4 Disconnect CTRL+V Paste
CTRL+F5 Parse query and check syntax CTRL+W Window selector
CTRL+G Go to line CTRL+X Delete
CTRL+H Replace CTRL+Z Undo
CTRL+I Index Tuning Wizard F1 Help for Query Analyzer
CTRL+K Display/hide execution plan F2 Move to next bookmark
CTRL+L Display execution plan F3 Repeat last search
CTRL+N New query window F4 Object Search
CTRL+O Connect F5 Execute a query
CTRL+P Print F6 Switch between query and result panes
CTRL+R Show/Hide results pane F8 Show/hide Object Browser
CTRL+S Save SHIFT+F1 Transact-SQL help
CTRL+SHIFT+0 Show options SHIFT+F2 Move to previous bookmark
CTRL+SHIFT+C Comment out code SHIFT+TAB Decrease indent
CTRL+SHIFT+DEL Clear the active Editor pane SHIFT+F6 Switch panes
CTRL+SHIFT+F Save results to file TAB Increase indent

Download the PDF

Reference: Pinal Dave (http://blog.SQLAuthority.com), MSDN