How to add custom SP calls to SSMS toolbar
Asked Answered
A

3

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.

Agonistic answered 27/2, 2017 at 8:20 Comment(0)
R
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

Ragamuffin answered 13/3, 2017 at 8:4 Comment(1)
Yep, that was nasty but this is what exactly I was looking for. Many thanks!Agonistic
F
1

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

Fantasy answered 1/6, 2022 at 12:51 Comment(1)
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.Zeppelin
E
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

Erubescent answered 30/8, 2023 at 1:54 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.