What are the challenges you face when working across database platforms? Take the survey
Options

SSMS Hotkeys

MelBMelB Posts: 5
edited November 19, 2014 11:55AM in SQL Prompt
The latest version of SQL Prompt has overwritten the hotkeys used by SQL Server Management Studio. I and my colleagues use these keys often. Please give them back. I miss them terribly.

The most common ones are,

<Ctrl><Shift><P> - in SSMS this opens a SQL template

<F2> - in SSMS this navigates the query editor to a saved bookmark

Comments

  • Options
    Aaron LAaron L Posts: 596 New member
    Hi MelB,

    I'm sorry Prompt has taken over your hotkeys!

    Could I ask which version of SSMS you're currently using and were these custom hotkeys or did they come as SSMS defaults? We thought that they were unused by default.

    Thanks,
    Aaron.
  • Options
    Hi Aaron, thanks for the quick response. I should have checked the forum while on vacation.

    These are the default hotkeys in SSMS since SQL 2000. This is a keyboard option that can be set through the following menu commands.

    Tools > Options > Environment > Keyboard > Keyboard Scheme > SQL Server 2000

    I'm still working on getting hotkeys to work properly in SSMS 2008 and later versions, but I'm sure there's a way.

    I have loved hotkeys every since I cut my eyeteeth on green-screen DOS decades ago. It would be great if I didn't have to learn a new set over the old set.
  • Options
    Aaron LAaron L Posts: 596 New member
    Hi MelB,

    Thanks for the extra info - I had completely missed that you could use the sql2000 scheme in 2008. It looks like Microsoft hasn't given an alternative for what ctrl+shift+p used to do, so it's not just a matter of leaning the new hotkeys either.

    I think the best approach here would be to allow you to customize the Prompt keyboard bindings to avoid this conflict. Unfortunately most of them are hardcoded in the current build so I'll have a look into configuring them from a file. Hopefully I'll have a new build for you to try tomorrow.

    Thanks,
    Aaron.
  • Options
    Yes, yes, thank you, thank you!
  • Options
    Aaron LAaron L Posts: 596 New member
    Hi MelB,

    I've made a private build for you here which allows you to override the keyboard bindings from an options file. There's no UI at the moment, so it'll involve manually editing the file:

    1) Open %localappdata%Red GateSQL Prompt 6RedGate_SQLPrompt_CommonUI_Options_UIOptions.xml
    2) Add the following anywhere under the <UIOptions>...</UIOptions> tags:
    &lt;KeyboardBindingOverrides version="1" type="RedGate.SQLPrompt.CommonUI.Options.KeyboardBindingOverrides"&gt;
      &lt;Overrides type="Overrides" version="2"&gt;
        &lt;value version="1" type="Override"&gt;
          &lt;CommandName&gt;TogglePromptEnable&lt;/CommandName&gt;
          &lt;Bindings /&gt;
        &lt;/value&gt;
        &lt;value version="1" type="Override"&gt;
          &lt;CommandName&gt;Rename&lt;/CommandName&gt;
          &lt;Bindings&gt;SQL::Ctrl+B, Ctrl+R&lt;/Bindings&gt;
        &lt;/value&gt;
      &lt;/Overrides&gt;
    &lt;/KeyboardBindingOverrides&gt;
    
    3) Start SSMS and set the keyboard scheme to sql2000

    This will remove the binding for enabling/disabling Prompt and set the rename variable/alias command to "Ctrl+B, Ctrl+R".
    Sorry it's a little fiddly, if you have any problems with it just let me know!

    We'll include this in the next stable release of Prompt so the next time you upgrade it should keep the re-bindings and allow you to continue using the sql2000 scheme.

    Thanks,
    Aaron.
  • Options
    Thanks, Aaron!

    I'll try this update when the developers are off of the terminal server.

    ...Mel
Sign In or Register to comment.