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. When the menu item is selected, a new query window is opened displaying your tsql script. The menu item can be configured to automatically substitute tags in the script and also execute it.

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

GitHub release (latest by date) GitHub license

Object Explorer

Install

There are two options for installing the SSMS Object Explorer Menu extension in SQL Server Management Studio (SSMS). The recommended method is to run the VSIX installer package. The alternative method is to manually extract the files into the Extensions folder.

VSIX installer

Download the SSMSObjectExplorerMenu.vsix from the latest release.

Double click on the SSMSObjectExplorerMenu.vsix to run it and install the SSMS Object Explorer Menu extension.

Start VSIX extension install

Completed VSIX extension install

Manual installation

Download the SSMSObjectExplorerMenu.zip from 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.

Unblock zip file via properties dialog

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\Microsoft SQL Server Management Studio 21\Release\Common7\IDE\Extensions\SSMSObjectExplorerMenu.

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

Please note that SSMS 21 does allow installing extensions in a different location. You may need to search around for SSMS’s 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. Object Explorer 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:

Example 1

select
    '{SERVER}' as [server]
    , '{DATABASE}' as [database]
    , '{SCHEMA}' as [schema]
    , '{TABLE}' as [table]
    , '{VIEW}' as [view]	
    , '{STORED_PROCEDURE}' as [stored_procedure]
    , '{FUNCTION}' as [function]
    , '{JOB}' as [job]
    , '{YYYY-MM-DD}' as [date]
    , '{HH:mm:ss}' as [time]
    , '{YYYY-MM-DD HH:mm:ss}' as [datetime]

Example 2

select top 10
	*
from {DATABASE}.{SCHEMA}.{TABLE}

Compatibility

This extension has been tested and used with SQL Server Management Studio 21.1.3.

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

Compatibility with other extensions are still being tested.

Extension Status
Redgate SQL Search Compatible
Redgate SQL Prompt Compatible

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

SQL Server Management Studio 20.x

SSMS 20.x is no longer supported. The last version compatibile with SSMS 20.x is version 2.3. Please consider upgrading to the latest version of SQL Server Management Studio.

SQL Server Management Studio 19.x

SSMS 19.x is no longer supported. The last version compatibile with SSMS 19.x is version 1.7.2. Please consider upgrading to the latest version of SQL Server Management Studio.

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.

FAQ

Where can I get the source code for the SSMS Object Explorer Menu extension?

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

How can I contribute to the project?

Please log any bugs found at https://github.com/brink-daniel/ssms-object-explorer-menu/issues. We also welcome pull requests. If you can fix a bug in the code or improve a feature, please do send us a pull request. We will happily review the change, test and merge it.

Why do you only support the latest version of SSMS?

Currently we only have one developer working on the SSMS Object Explorer Menu extension and all work is unpaid and done in private time. Limiting the support to only the latest version of SSMS reduces the complexity of the project and makes the code easier to maintain and support. Due to the productivity enhancements that the SSMS Object Explorer Menu extension provides, we want this this project to survive for a very long time. Keeping it simple will help this project survive.

Why was the SSMS Object Explorer Menu extension created?

We are all SQL Server Database Developers. We spend 8 hours a day in SSMS and lots of that time is spent using the https://tsqlt.org unit testing framework. tSQLt is amazing, but it lacks a free and open source UI. The SSMS Object Explorer Menu extension was created out the desire to be able to right-click on any stored procedure in the Object Explorer and select an option to run all unit tests related to the stored procedure. Subsequently, the SSMS Object Explorer Menu extension evolved to allow any inline tsql statement or scripts files to be executed directly from the right-click menu in the Object Explorer.

If you are new to tSQLt, have a look at their Quick Start guide here. We’ve also written a great article about how to solve the Insert Exec Statement Cannot be Nested problem.

Why is the SSMS Object Explorer Menu extension free and open source?

We love SSMS and especially SSMS extensions. They make our lives better. We would love to see more extensions for SSMS. Please fork our code, create something and share it.

Why use the SSMS Object Explorer Menu extension when other extensions also allow users to create custom menu items?

SSMS extensions should only do one thing and do it well. The problem with a lot of extensions are that they have too many features and subsequently become intrusive or slow down SSMS. The SSMS Object Explorer Menu extension only adds context sensitive menu items to the Object Explorer in SSMS and have no impact on SSMS application loading times or UI performance. The menu items allow for the substitution of tags in their configured tsql script, with context specific values such as database, table or stored procedure name.

How do I uninstall the SSMS Object Explorer Menu extension?

Simply delete the SSMSObjectExplorerMenu folder from C:\Program Files\Microsoft SQL Server Management Studio 21\Release\Common7\IDE\Extensions and restart SQL Server Management Studio.

Known Issues

Not running/No options

This happens when Windows security blocks dll files downloaded from the internet.

Error message when files are blocked

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.

How to unblock files via properties dialog

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

Credits

All development is done by Daniel Brink.

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

Change Log

v3.1 (2025-06-10)

v3.0 (2025-06-08)

v2.3 (2024-12-23)

v2.2 (2024-11-12)

v2.1 (2024-03-23)

v2.0 (2024-03-21)

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)