THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

Aaron Bertrand

Aaron is a senior consultant for SQL Sentry, Inc., makers of performance monitoring and event management software for SQL Server, Analysis Services, and Windows. He has been blogging here at sqlblog.com since 2006, focusing on manageability, performance, and new features; has been a Microsoft MVP since 1997; tweets as @AaronBertrand; and speaks frequently at user group meetings and SQL Saturday events.

SQL Server v.Next (Denali) : Getting Ctrl+R to work again

Ctrl+R is a good friend of mine - we go way back. It is very handy to use this command not only to hide the results pane away and focus on the query at hand, but to also be able to bring the results back just as quickly - without having to run the query again, or mess with click + drag nonsense.

In Denali, we get a new version of SSMS, tightly integrated into the Visual Studio shell. With that we get some great benefits (and I've talked about them before). In that post I also point out some of the problems - they've fixed the double-click on an error message bug, for example, but they haven't fixed some other things, such as Ctrl+U = lower case, instead of the more logical Ctrl+Shift+L (to match Ctrl+Shift+U for upper case).

The one that really got my goat yesterday is that Ctrl+R has been assigned to some other function. On a freshly-minted virtual machine, with a brand new install of Windows 7 (including 88 items from Windows Update), I laid down a clean install of Denali (very simple - just engine, BIDS, BOL and management tools - no Juneau, Visual Studio, Analysis Services or other BI features, etc etc). On the first launch of SSMS (where I am supposed to be asked for my keyboard preferences, but no prompt appeared), I opened a new query window, typed "SELECT 1;", and hit F5. I received a results pane with (No column name) / 1. Exactly as I expected. Then the trouble begins. I hit Ctrl+R; nothing happens. I wonder if I pressed the wrong letter, didn't fully press Ctrl, or what, so I press it again. My computer beeps at me like I was trying to double-click on the A: drive in Windows Explorer.

As a true sign of my insanity, I keep trying - expecting a different outcome with the same input. Then I notice the status bar changing as I fruitlessly try to make the results pane go away. On first press of Ctrl+R, I see this in the bottom left corner:

 

And when I press it again, along with the beep, the status bar changes to this:

 

Okay, so now we're onto something - it seems this change was intentional. So off I go to Tools / Options / Keyboard / General to see what's what. In the middle box, select Window.ShowresultsPane, change the "Use new shortcut in:" dropdown to SQL Query Editor (Global did not work for me), put your cursor in the "Press shortcut keys:" box and hit CTRL + R. You should see the following:

 

So I'm not sure what this Edit.SwapAnchor command is supposed to be, or why I give a rip about some DataWarehouse Designer - as I thought I had voted, simply by my installation choices, that I'm not crazy into BI. I'm sure this command is important to someone, and for them, the default will work just fine. For the other 99.99% of Management Studio users, you can fix this now by clicking Assign and then OK. Unlike some other changes that still require an SSMS restart to take effect (e.g. experimenting with font choices in grid results can be fun), the change takes effect immediately.

If you want to fix many of these keyboard shortcuts in one swoop, see this post from Denny Cherry (@mrdenny), where he provides a settings file you can import easily (just be aware that not all of his customizations match the original 2008 R2 settings exactly):

http://itknowledgeexchange.techtarget.com/sql-server/resetting-ssms-shortcut-keys-in-sql-server-denali-ctp-3/

I am hoping that the RCs or, at the very least, the RTM versions, show a keyboard scheme that says "SQL Server settings" instead of a generic "default." And that this default does not include Ctrl+R being assigned to a DataWarehouse Designer operation unless I say I want it that way.

EDIT
Microsoft has published the official instructions for resetting the keyboard, should you find yourself in this situation, and there is in fact a SQL Server mode (the choices in Tools/Options, "default" and "Visual Studio 2010 Compatible" are not that obvious - again, I'm hoping this gets changed to match the reset dialog). See the following blog post for more info:

http://blogs.msdn.com/b/sqlrem/archive/2011/07/13/enhanced-keyboard-shortcuts-in-ssms-in-denali.aspx

 

Published Thursday, July 14, 2011 12:52 PM by AaronBertrand

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Pierre Cardona said:

Thank you, thank you, thank you.

July 14, 2011 1:41 PM
 

Pierre Cardona said:

Have you had any problems in SSMS with the "Open File" or "Save File As" dialog boxes not showing mapped network drives?  I'm seeing this on an x64 installation on a Windows Server 2008 R2 host.  All other apps I've tried on the server can see mapped network drives.  An x86 installation on another host does not have this issue.

July 14, 2011 2:18 PM
 

AaronBertrand said:

No, mapped drives work just fine for me. Silly question but have to ask, are you running as administrator?

July 14, 2011 2:43 PM
 

AaronBertrand said:

Let me rephrase, do you notice a different behavior if you right-click the SSMS shortcut and choose "Run as administrator"? Do you have UAC enabled?

July 14, 2011 2:48 PM
 

Pierre Cardona said:

I'm logging onto Windows as an Administrator and am also running SSMS as an Administrator; it shows (Administrator) in the title bar of SSMS while running.  I can drill down into "Network" to find the resources I want, but mapped network drives aren't shown with other drive letters in the "Computer" node of the tree.  The open and save as dialogs in other apps, such as BIDS, Notepad and Internet Explorer, do not have the same issue.  I'll keep playing with it and share any interesting news.

July 14, 2011 3:02 PM
 

AaronBertrand said:

I definitely see mapped drives under Computer:

http://bertrandaaron.files.wordpress.com/2011/07/ssms_mapped.png

However I am using VMWare Fusion and so there might be different network behaviors at play. Have you run any tools to determine whether SSMS tries to get out to those mapped drives?

Also there might be something here - I remember Paul Randal battling with a performance issue that seems related, is it possible you have mapped drives that are not showing up because they're very slow or offline?

http://www.sqlskills.com/BLOGS/PAUL/post/Ever-had-poor-performance-saving-files-in-SSMS-over-slow-network.aspx

http://connect.microsoft.com/SQLServer/feedback/details/651176/ssms-tries-to-access-disconnected-network-drives-when-in-the-save-file-as-wizard

http://connect.microsoft.com/VisualStudio/feedback/details/114463/slow-file-save-when-recent-files-projects-on-a-network-drive

July 14, 2011 3:11 PM
 

Pierre Cardona said:

As you suggested earlier, the issue appears to be related to UAC.  My initial setting was "Default".  When I changed it to "Never notify" and rebooted, mapped network drives were then visible in the SSMS open and save as dialog boxes.  For fun, I changed the setting back to "Default", rebooted, and the mapped drives then disappeared.  After that, I changed the UAC setting back to "Never notify", rebooted, and was able to see mapped network drives again in the SSMS open and save as dialog boxes.  I have not tried either of the other two UAC settings to see what impact they would have.

Thanks for your continuing community support.

July 14, 2011 3:31 PM
 

araghhhhhh Ctrl+R doesn’t work in Denali!!!! » SQL Server and Beyond said:

July 25, 2011 1:42 PM
 

araghhhhhh Ctrl+R doesn’t work in Denali!!!! » SQL Server and Beyond said:

July 25, 2011 1:42 PM
 

Balaji said:

Thank you Aaron, I have been wondering for sometime, how to get back my Ctrl+E and Ctrl+R for the obvious choice that I am used to since long:)

August 5, 2011 1:04 AM
 

Jeetendra said:

Thank you..

September 15, 2011 2:10 AM
 

Finn said:

Thank you. Save me time to find.

December 13, 2011 5:45 PM
 

Arthur said:

The functionality is not present in the SSIS 2012 RTM build, too.

Yet, reportedly, the workaround does not work in it.

I have a MS Connect item asking to fix that at http://bit.ly/xaF3Jf.

Hopefully it gets enough votes to be resolved in SP1 of SQL Server 2012.

March 12, 2012 11:38 AM
 

BJReplay said:

Your blog post combined with my google-fu restored my CTRL+R goodness.

April 1, 2012 2:07 AM
 

Tracy McKibben (RealSQLGuy) said:

Thank you, thank you, thank you.  This was driving me nuts...

April 11, 2012 11:08 AM
 

Jens Frandsen said:

Thanks!! Never heard of Denali, but this functionality in MSSQL 2012 stopped working as it did in 2008/2005/2000/7 and I'm of the group that use CTRL+R regularly and glad to have it back.

Thanks again.

April 12, 2012 4:15 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit

About AaronBertrand

...about me...

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement