8

Recently I've found out, that there's an option to include most commonly used queries to be executed by clicking a button on SSMS toolbar.

You can do that by following these steps:

  1. Right mouse click on toolbar
  2. Click Customize
  3. Create new toolbar
  4. Modify it
  5. Add Command
  6. Under Query categories there's option to add up to 9 Custom SPs

Now when I came here, things look like that: enter image description here

However I'm struggling on how to add the actual procedure, that needs to be executed.

There's an option to add multiple SPs:

  1. Custom SP 1
  2. Custom SP 2
  3. ...
  4. sp_help
  5. sp_lock
  6. sp_who

How do I assign my procedure to be Custom SP 1, for instance?

To be clear: My goal is to have a button in SSMS toolbar, which would execute my desired procedure (query) on click.

lokusking
  • 7,396
  • 13
  • 38
  • 57
Evaldas Buinauskas
  • 13,739
  • 11
  • 55
  • 107

3 Answers3

5

This is a great question imo, but to do this it's an awful way you'll have to go.

Unfortunately i have the German version of SSMS, so my screens might confuse you a little.

Following you can see a guide:

First Step The Options-Window

Step two Select a free Shortcut

Final Assign to Toolbar

This seems a bit uncomfortable, but this is the only way i know / can imagine on how to do this.

Let me know if this helps! Cheers

lokusking
  • 7,396
  • 13
  • 38
  • 57
1

English version of SSMS Go to Tools-> options enter image description here

Arry
  • 29
  • 5
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 02 '22 at 01:40
0

I found that I needed to offset the "Custom SP #" button by 1.
ie I've assigned a command to Query Shortcut "Ctrl + 9" which will be run when I use the "Custom SP 8" command to add to the toolbar.

enter image description here

Daz
  • 41
  • 3