Object Explorer Menu is a free, open-source extension for SQL Server Management Studio (SSMS), developed in C#. It enables users to add custom menu items to the right-click context menu within the Object Explorer window.
These menu items can be configured to run either external T-SQL script files or inline T-SQL statements. Upon selection, the extension opens a new query window displaying the script. It also supports tag substitution within scripts and optional automatic execution, streamlining routine database tasks and enhancing productivity.
The project homepage is https://sqlmedic.com.
Download the SSMSObjectExplorerMenu.vsix from the latest release.
Double click on the SSMSObjectExplorerMenu.vsix to run it and install the Object Explorer Menu extension.
Once the Object Explorer Menu extension is installed, new menu items can be added to the Object Explorer using either of the following two methods:
- Right-click on the node in the Object Explorer where you would like to add a context menu item and select
New
from theMy Scripts
menu. - 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.
The following settings are available for each menu item:
- Confirm - Ask confirmation to continue before executing a script file or inline tsql statement
- Context - Tree node level where to display the menu item. For example:
- All
- Server
- Server/DatabasesFolder
- Server/Database
- Server/Database/UserTablesFolder
- Server/Database/Table
- Server/Database/View
- Server/Database/StoredProceduresFolder
- Server/Database/StoredProcedure
- Server/JobServer
- Server/JobServer/JobsFolder
- Server/JobServer/Job
- Enabled - Show/hide the menu item.
- Execute - Automatically run the selected script or tsql statements when the menu item is selected.
- Name - Text displayed on the menu item.
- Script - Inline tsql statements OR path to script file.
The following tags are replaced in tsql scripts and statements before execution:
{SERVER}
{DATABASE}
{SCHEMA}
{TABLE}
{VIEW}
{STORED_PROCEDURE}
{FUNCTION}
{JOB}
{YYYY-MM-DD}
{HH:mm:ss}
{YYYY-MM-DD HH:mm:ss}
{OBJECT}
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]
, '{OBJECT}' as [object]
select top 10
*
from {DATABASE}.{SCHEMA}.{TABLE}
This extension has been tested and used with SQL Server Management Studio 21.5.14.
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.
SSMS 20.x is no longer supported. The last version compatible with SSMS 20.x is version 2.3. Please consider upgrading to the latest version of SQL Server Management Studio.
SSMS 19.x is no longer supported. The last version compatible with SSMS 19.x is version 1.7.2. Please consider upgrading to the latest version of SQL Server Management Studio.
Requirements for compiling the source code:
- Visual Studio 2022
- Toolset: Visual Studio extension development
The Visual Studio extension development toolset can be installed via the Tools > Get Tools and Features
menu inside Visual Studio.
You can find the full source code, documentation, and issue tracker on our GitHub repository: https://github.com/brink-daniel/ssms-object-explorer-menu
If you encounter any issues, please report them on our GitHub Issues page. We also welcome community contributions. If you'd like to fix a bug or enhance a feature, feel free to submit a pull request. All contributions are reviewed, tested, and considered for inclusion in the project.
The Object Explorer Menu extension is currently maintained by a single developer, with all work done voluntarily during personal time. To keep the project sustainable and maintainable, support is limited to the latest version of SQL Server Management Studio (SSMS).
Focusing on a single SSMS version reduces complexity, simplifies maintenance, and ensures a more stable experience for users. Given the productivity benefits this extension offers, our goal is to ensure its longevity—and keeping it simple is key to that goal.
As full-time SQL Server database developers, we spend countless hours in SQL Server Management Studio (SSMS)—often working with the tSQLt unit testing framework. While tSQLt is a powerful tool for database testing, it lacks a free and open-source UI for seamless interaction.
The Object Explorer Menu extension was born from a simple need: the ability to right-click a stored procedure in the Object Explorer and run all related unit tests with a single action. From that initial idea, the extension has evolved to support the execution of any inline T-SQL statement or script file directly from the right-click context menu in Object Explorer.
If you're new to tSQLt, we recommend starting with their Quick Start Guide. You might also find our article on resolving the common “INSERT EXEC statement cannot be nested” issue helpful.
We’re passionate about SQL Server Management Studio (SSMS)—and especially about SSMS extensions, which enhance productivity and make daily work easier.
We’d love to see more developers building great extensions for SSMS. Feel free to fork our code, experiment, and create something useful. If you build something cool, share it with the community!
Why use the Object Explorer Menu extension when other extensions also allow users to create custom menu items?
SSMS extensions should follow the Unix philosophy: do one thing and do it well. Many extensions become bloated with excessive features, which can lead to performance issues or interfere with the SSMS user experience.
The Object Explorer Menu extension is intentionally lightweight and focused. It adds only context-sensitive menu items to the Object Explorer, with no impact on SSMS startup time or overall UI performance. Each menu item supports tag substitution, enabling scripts to dynamically incorporate context-specific values such as the selected database, table, or stored procedure name.
To uninstall the Object Explorer Menu extension, simply delete the SSMSObjectExplorerMenu folder located at: C:\Program Files\Microsoft SQL Server Management Studio 21\Release\Common7\IDE\Extensions
.
After deleting the folder, restart SQL Server Management Studio to complete the uninstallation.
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.
- Add support for
{OBJECT}
tag - Icons to indicate menu item actions for Execute and Confirm
- Version number on New Menu Item window
- Added VSIX installer
- SSMS 21.1.3 compatibility
- Add support for
{YYYY-MM-DD}
,{HH:mm:ss}
and{YYYY-MM-DD HH:mm:ss}
tags - Fix bug causing the
{TABLE}
tag to be populated with the view name when using the{VIEW}
tag
- Add support for
{VIEW}
tag
- Import/export menu items and tsql scripts as xml
- SSMS 20.0 compatibility
- Usability improvements
- Allow custom menu items on any node in the Object Explorer
- Add support for
{FUNCTION}
tag
- Create unlimited number of menu items
- Reorder or remove menu items via Tools > Options dialog
- Quickly add menu items via new Add Menu Item dialog
- New option to ask confirmation to continue before executing script or tsql statement.
- Removed SQLMedic branding
- Usability improvements
- Add support for custom menu items on SQL Agent jobs
- Allow custom branding
- Optimize logic for retrieving tree node context information
- Public beta release.