Database.ca SQL Server Blog

My Blog

Monday, January 20 2014

Keywords: Custom toolbar, SQL Server 2012, Toolbar, SQL Server Management Studio Tool bar, SSMS Custom Toolbar

Customize your SQL Server 2012's Toolbar for a more efficient SSMS coding experience

The tips in this article do not apply to SQL Server 2008 R2. For the latter, I have written a separate article which you could find here.
 
Improve the speed and efficiency of your T-SQL programming by creating custom toolbars in your SQL Server Management Studio. The goal would be to create a toolbar where you place the commands that you personally use and need most often, and that they are currently non-existent in another SSMS active toolbar.

 

In this walkthrough, we will create a custom toolbar containing 4 commands:
1) Comment block
2) uncomment block
3) UPPERCASE block
4) lowercase block
 
With that in mind, let's go ahead an click on 'Cutomize' under 'Tools' menu.

 

Custom toolbar, SQL Server 2012, Toolbar, SQL Server Management Studio Tool bar, SSMS Custom Toolbar

Click on 'New' button and name your custom toolbar something that you like and will be easy to remember. I'm naming it after myself in order to easily spot it in a list of toolbar anytime in the future.

 

Custom toolbar, SQL Server 2012, Toolbar, SQL Server Management Studio Tool bar, SSMS Custom Toolbar

Once created, make sure to check off (select) the newly created toolbar on the list. You will then see a little small (and inactive) menu appear somewhere on the screen. You can drag and drop that empty toolbar within SSMS toolbar area, although it is not as flexible as previous versions...it snaps to the grid this time and you can't leave it just anywhere on the screen you please like before.

 

Custom toolbar, SQL Server 2012, Toolbar, SQL Server Management Studio Tool bar, SSMS Custom Toolbar

Do not close the window yet. Navigate to 'Commands' window. Select 'Toolbar' from the choice of option buttons, and scroll up and down in the list box and find your custom toolbar's name.

 

Custom toolbar, SQL Server 2012, Toolbar, SQL Server Management Studio Tool bar, SSMS Custom Toolbar

Click on 'Add Command...' button to start adding your own commands to this otherwise empty toolbar.

 

Custom toolbar, SQL Server 2012, Toolbar, SQL Server Management Studio Tool bar, SSMS Custom Toolbar

For the purposes of this walkthrough, select 'Edit' category and then scroll down to 'Selection Comment' and then press 'OK'.

 

Custom toolbar, SQL Server 2012, Toolbar, SQL Server Management Studio Tool bar, SSMS Custom Toolbar

Repeat the above for the remaining 3 commands.

 

Custom toolbar, SQL Server 2012, Toolbar, SQL Server Management Studio Tool bar, SSMS Custom Toolbar

You will now have your 4 desired commands in your custom toolbar, albeit inactive.

 

Custom toolbar, SQL Server 2012, Toolbar, SQL Server Management Studio Tool bar, SSMS Custom Toolbar

To activate your toolbar and make use of it...you would need a script file open. In this example I select the word 'test' and converted it to UPPERCASE. Go ahead now and create the exact toolbar to suit your very needs.

 

Custom toolbar, SQL Server 2012, Toolbar, SQL Server Management Studio Tool bar, SSMS Custom Toolbar

Written by Ramin Haghighat