Adding a Format SQL Button to the Redgate Toolbar

I’ve gotten used to CTRL+K,Y to format SQL with SQL Prompt, but a customer wanted a button on the toolbar. It’s fairly easy to do, but I thought I should document the process for others.

First, if you click the small area on the right of a toolbar in SSMS, you’ll get an “Add or Remove Buttons” menu, as shown here.

2017-11-14 16_29_31-~vs7FB.sql - DKRSPECTRE_SQL2016.sandbox (DKRSPECTRE_way0u (52))_ - Microsoft SQL

If you click that, you’ll see this dialog.

2017-11-14 16_29_39-~vs7FB.sql - DKRSPECTRE_SQL2016.sandbox (DKRSPECTRE_way0u (52))_ - Microsoft SQL

In  this case, I’m happy with the buttons, I want to customize my toolbar. Click that option. This opens up the dialog below, and I’ll want to click the “add Command” to add a menu item as a button.

2017-11-14 16_29_50-Customize

From here, I get a list of all SSMS menus. In this case, I’ve clicked the Dimension item, and I can see all the possible menu items on the right.

2017-11-14 16_30_02-Add Command

However, I want a SQL Prompt item, so I need to scroll down the left to SQL Prompt. Once I click that, I see the commands on the right,

2017-11-14 16_30_11-Add Command

Now scroll the right to find Format SQL.

2017-11-14 16_30_23-Add Command

Click OK and then your new button appears in the list.

2017-11-14 16_30_32-Customize

And on the toolbar.

2017-11-14 16_30_41-~vs7FB.sql - DKRSPECTRE_SQL2016.sandbox (DKRSPECTRE_way0u (52))_ - Microsoft SQL

Now you GUI clickers can reformat SQL quickly.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , , , . Bookmark the permalink.