Code Monkey home page Code Monkey logo

brink-daniel.github.io's Introduction

SSMS Object Explorer Menu is a free and open source extension for SQL Server Management Studio 19.1 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.

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 only been tested and used with SQL Server Management Studio 19.1.

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

This extension has not been tested alongside any other extensions.

Recompile for SSMS 18.x

Download the source code and replace the lib/SqlPackageBase.dll and lib/SqlWorkbench.Interfaces.dll with your local 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

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

Settings

Up to 20 menu items can be configured via the Options dialog window in SSMS Tools > Options > SQL Server Object Explorer > SQLMedic

  • Context - Set the tree node level where to display the menu item.
  • Enabled - Show/hide the menu item.
  • Execute - Automatically run the selected script or tsql statements.
  • Name - Text displayed on the menu item.
  • Path - Location of script file to execute OR tsql statements to execute.

Options Dialog

Text substitution

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

  • {SERVER}
  • {DATABASE}
  • {SCHEMA}
  • {TABLE}
  • {STORED_PROCEDURE}

Sample scripts

Context Script Description
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

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.

Compiling the source code

Requirements for compiling the source code:

  • Visual Studio 2022
  • Toolset: Visual Studio extension development

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

Change Log

v1.1 (2023-07-07)

  • Optimize logic for retrieving tree node context information

v1.0 (2023-07-04)

  • Public beta release.

brink-daniel.github.io's People

Contributors

brink-daniel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.