SQLMedic

SSMS Object Explorer Menu

SSMS Object Explorer Menu is a free and open source extension for SQL Server Management Studio (SSMS) written in C#. It allows custom menu items to be added to the right-click context menu in the Object Explorer window. The menu items can be used to execute any tsql script file or inline tsql statement.

The project homepage is https://sqlmedic.com.

GitHub release (latest by date) GitHub license

Object Explorer

Source code, documentation and issues can be found at https://github.com/brink-daniel/ssms-object-explorer-menu.

Information on how to access the Object Explorer and TreeView control was learnt by studying Nicholas Ross’s SSMS-Schema-Folders project.

Compatibility

This extension has been tested and used with SQL Server Management Studio 19.1, 19.2 and 19.3.

You can download the latest version of SSMS for free from Microsoft.

Compatibility with other extensions are still being tested.

Extension Status
SQL Search Compatible
SQL Prompt Compatible

Please let us know what other extensions you use in SSMS. We’ll try our best to ensure compatibility.

Recompile for SSMS 18.x

SSMS 18.x is not officially supported, but the SSMS Object Explorer Menu extension can be recompiled with the correct dll files for SSMS 18.x and made to work. Download the source code and replace the lib/SqlPackageBase.dll and lib/SqlWorkbench.Interfaces.dll with your local SSMS 18.x version of the same files found in C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE. Then recompile the extension and follow the installation instructions below.

Install

Download the latest release

You must unblock the zip file before extracting it. Right click on the zip file in Windows Explorer and select Properties. If you see an Unblock button or checkbox then click it.

Extract the zip file and copy the SSMSObjectExplorerMenu folder into the SSMS extension folder. Remove or replace any previous version.

The default install location is C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\Common7\IDE\Extensions.

When installed correctly, you should have the following folder & file structure:

Please note that SSMS 19 does allow installing extensions in a different location. You may need to search around for the Extensions folder.

How to add menu items to the Object Explorer

Once the SSMS Object Explorer Menu add-in is installed, new menu items can be added to the Object Explorer using either of the following two methods:

  1. Right-click on the node in the Object Explorer where you would like to add a context menu item and select Add menu item from the My Scripts menu. Add Menu Item
  2. Open the Options dialog window in SSMS Tools > Options > SQL Server Object Explorer > SSMS Object Explorer Menu and add new menu items to the collection. Menu items can also be rearranged or removed using the Options dialog. Options Dialog

Settings

The following settings are available for each menu item:

Text substitution

The following tags are replaced in tsql scripts and statements before execution:

Sample scripts

Context Script
All
 
text_substitution_demo.sql
Demo of text substitution
Server_Database_Table
 
script_data_as_insert.sql
Script data as insert statements
Server_Database_StoredProcedure
 
stored_procedure_unit_test.sql
Run tSQLt unit test for a stored procedure
Server_Database_StoredProceduresFolder
 
stored_procedure_unit_test_all.sql
Run all tSQLt unit tests

More tsql scripts are available here.

Compiling the source code

Requirements for compiling the source code:

The Visual Studio extension development toolset can be installed via the Tools > Get Tools and Features menu inside Visual Studio.

Roadmap

Features that are planned for future releases:

Known Issues

Not running/No options

This happens when Windows security blocks dll files downloaded from the internet. Unblock the zip file BEFORE extracting it.

Please report any issues to https://github.com/brink-daniel/ssms-object-explorer-menu/issues.

Change Log

v1.7 (2023-08-01)

v1.6 (2023-07-25)

v1.5 (2023-07-23)

v1.4 (2023-07-22)

v1.3 (2023-07-15)

v1.2 (2023-07-11)

v1.1 (2023-07-07)

v1.0 (2023-07-04)