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):
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
Great thanks!
Great thanks for the article and links.
WTH! I was so frustrated too! Anyway, Thanks. Should have consulted google immediately.
Thanks so much. I also missed that short-cut dearly and I'm so happy to have it back. 🙂
Thanks!! very very usefull article..it's working for me
Thanks!!! Very usefull article!
Thanks a million
Thanks. This was very helpful.
There is no problem when I open SSMS, but when I used to open SSMS as a different user the Ctrl+R combination didn't used to work.
Now after going by the steps you provided it is working perfectly.
Thanks!
SQLwithManoj.wordpress.com
If only I had a bag of flawless diamonds, I'd pour them all over your hands! THANK YOU SO MUCH!!!!!!!!!
The info provide is worthwhile. Thanks a Milliion.
Thanx its working…..
Thank You!!
Just wanted to say thanks – thanks!
Thanks a Lot.. Its gr8
Thank you Aaron! I was following the same path as you described, and since I change between different computers and servers didn't realize until today that it was a SSMS change, but still I didn't know what to do with that information "The key combination (Ctrl+R, Ctrl+R) is not a command." that showed up in status bar. Great work there finding what to do about it.
Excelent!!
m
thanks very much
muchas gracias
Bolton, wow, I'm very sorry my writing style is unsatisfactory to you and that you must be sarcastic about how painful it is for you to read it.
As far as it not working, you'll notice that the post was written LONG before the final version of SQL Server 2012 was released. Let me contact accounting to see what we can do about a refund. 🙂
ARG! Boy do I sound like a bitch, but…. this didn't work for me! I see per above and in other postings that this work around doesn't work for VS SQL Server Managment Studio 2012.
ARG! First and foremost, thank you for the solution…BUT, as frustrating it is to hit the problem, a post like this is just as frustrating. Can't you just say in the first sentence, "To resolve…" I've done my usual quick pass through your text and didn't find the solution. I've done a 2nd pass, and I suspect the answers in there somewhere. Now I have to go through and read every thought you've had over the past 3 months to figure out where in there is the solution.
ARG! First and foremost, thank you for the solution…BUT, as frustrating it is to hit the problem, a post like this is just as frustrating. Can't you just say in the first sentence, "To resolve…" I've done my usual quick pass through your text and didn't find the solution. I've done a 2nd pass, and I suspect the answers in there somewhere. Now I have to go through and read every thought you've had over the past 3 months to figure out where in there is the solution.
Thanks a lot for the help. Great
Thanks a lot
It's working.. saved my time.. Thank you..
It works! thanx!
It is nice article with simple steps and images to understand easily.
Good Article. Thank you
The window was open and i was just about to unplug the PC and throw it out when i found your blog post.
Thanks!
yep, but if anyone can solve the following issue
that how we can make custom commands and assign them the new shortcuts? Especially how to map "query.customsp?" short cuts :S
thank you!
Thank you for reuniting me with my friend ctrl R
Thank you!!!
This helped and relieved my pain 🙂
Thank you! Holy Crap that was killing me!
Why in the hell would they turn that off?!
Grant
Hey, thanks for the post. Question: do you know how to assign a proc to the "Query.CustomSP1", SP2, etc commands? thx
Thanks dude!
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.
Thank you, thank you, thank you. This was driving me nuts…
Your blog post combined with my google-fu restored my CTRL+R goodness.
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.
Thank you. Save me time to find.
Thank you..
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:)
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.
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://web.archive.org/web/*/http://web.archive.org/web/*/https://connect.microsoft.com/SQLServer/feedback/details/651176/ssms-tries-to-access-disconnected-network-drives-when-in-the-save-file-as-wizard
http://web.archive.org/web/*/http://web.archive.org/web/*/https://connect.microsoft.com/VisualStudio/feedback/details/114463/slow-file-save-when-recent-files-projects-on-a-network-drive
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.
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?
No, mapped drives work just fine for me. Silly question but have to ask, are you running as administrator?
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.
Thank you, thank you, thank you.