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!

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)

About these ads

MySQL – Download MySQL Workbench Shortcut in PDF

MySQL 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.

SELECT *
FROM (SELECT *
FROM (SELECT *
FROM (SELECT *
FROM Sales.Currency)a)b)c

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

SELECT *
FROM (SELECT *
FROM (SELECT *
FROM (SELECT *
FROM Sales.Currency)a)b)c

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

SELECT *
FROM (SELECT *
FROM (SELECT *
FROM (SELECT *
FROM Sales.Currency)a)b)c

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

SELECT *
FROM (SELECT *
FROM (SELECT *
FROM (SELECT *
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

Cursor position 2

Cursor position 3

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.)

Shortcuts:

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
F6

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 :
sqlwb
[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.
sqlwb

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)