10 Ways To Make The Most
Of SSMS


I spend a lot of my day in SQL Server Management Studio (SSMS). It’s highly customisable with plenty of tools and shortcuts to make life easier.

These are just a handful of the options available that I find most useful.


Create a list of comma-separated columns
Use the query window to edit side by side
Use the keyboard shortcuts
Displaying line numbers
Moving columns in the results pane
Open a new query window on start up
Adding commas to a list in one step
Select a colour for each environment you use
Use the performance reports
Filter objects in Object Explorer


Create a list of comma-separated columns

If you want a comma separated list of all columns from a table in your query window, you can do this by dragging the ‘Columns’ item from Object Explorer it onto to a query window.

 


Use the query window to edit side by side

When editing two code blocks it can be useful to see them both side by side.

By clicking on the query header and selecting ‘new vertical group’ you are able to then edit and scroll two queries independently.

sql-vertical-split


Use the keyboard shortcuts

Spend more time writing queries by using the shortcuts instead of pointing and clicking.

These are the shortcuts I find handy:

  • Execute currently selected code – F5
  • Show/hide the results pane – CTRL + R
  • Open a new query window – CTRL + N
  • Display the query execution plan – CTRL + L

Displaying line numbers

Enabling line numbers makes it easier to find where the problems are when SSMS throws you an error.

This is especially useful when you’re working with long queries. To turn this on go to:

Tools > Options > Text Editor

 


Moving columns in the results pane

If you have a lot of columns in your result set and want to change their order without having to rerun the query, simply drag the column headers and drop them in your preferred order.


Open a new query window on startup

When this option is turned on, SSMS opens up a new Query Window once you are connected. To turn this on go to:

Tools > Options > Environment > Startup


Adding commas to a list in one step

Instead of manually adding commas or quotes between a list of columns or strings you can do this all in one go by using Alt.

Hold the key down as you click where you’d like to start and you should see a faint line appear.

Drag this down to where you’d like to start editing and make your changes. This can also be used for deleting in one step.


Select a colour for each environment you use

If you are in multiple environments each day, you may find it useful to have a different colour for each connection – pink for UAT, blue for Dev, red for Prod indicating where you should be cautious. On startup go to:

Options > Connection Properties > Use custom colour


Use the performance reports

The standard performance and troubleshooting reports are presented with user-friendly graphs and tables so you don’t have to do anything else or trawl through scripts finding what you need.

Right click on the database you’re interested in:

Reports > Standard Reports > Pick your report


Filter objects in Object Explorer

Use the objects filter to make finding an object by name easier. Expand the database you’re interested in:

Tables > Right click > Filter > Filter Settings.

From here you can filter by name. To clear the filter, right-click Tables, and then select Remove Filter.


There are many ways to customise SSMS but these are the most useful ways I’ve found to make it work for me.


Photo by Adrianna Calvo from Pexels

 

Bitnami