Ssms-Tips-Tricks

SSMS Tips and Tricks 5-8: Turning off completion times

I’ve had many developers ask me how can I turn off those annoying completion time messages in SSMS?.

A while back, the product team decided that we’d all like completion times shown in the Messages output tab. I don’t share their enthusiasm for them.

For a start, a completion time was already shown here in the Properties window for the query, along with much more info:

So, for me, it really was quite irrelevant. Worse, I often use the output of the Messages tab as text for scripts, etc. The last thing I wanted were a bunch of completion times sprinkled through those.

2025-09-02

SSMS Tips and Tricks 5-7: Viewing queries and results in separate tabs

In SSMS, query results are normally shown at the bottom of the query window.

This can greatly reduce the screen real estate both for the query, and for viewing the results.

In Tools, Options, Query Results, SQL Server, Results to Grid, there is an option to Display results in a separate tab. This can be very useful and generally you will also want to choose the extra option to Switch to results tab after the query executes.

2025-08-31

SSMS Tips and Tricks 5-6: Playing a sound when a query completes

In a previous post , I mentioned that when a long running query completes, I might not have been waiting around for it, and so I wanted to know when it completed.

But sometimes I do wait around for a query to complete, yet I’m distracted by other things and don’t realize that the query has actually completed. That’s not surprising because if a query takes a long time, I’m probably going to go on with other work while that’s running.

2025-08-29

SSMS Tips and Tricks 5-5: Determining when a query finished

It’s likely that everyone who uses SSMS knows how to tell how long a query ran for. You can see it in the bottom right of the status bar when a query finishes.

But one question that often comes up with a long-running query is when did my query finish?

That’s not in the status bar and many people don’t seem to be aware that you can determine that.

It’s part of the data in the Properties window. So when you come to a query window where the query has finished, and you’re wondering when it finished, hit F4 (or right-click in the window and click Properties), and you’ll see this info shown:

2025-08-27

SSMS Tips and Tricks 5-4: Finding error locations within scripts

This is probably one of the simplest tips that I’ve published, yet I’m endlessly surprised how many people do not realize that it’s available.

When you have a script loaded in SSMS, and you execute the script, you might run into an error like this:

To find where the error is, just double-click the error down in the Messages tab. I double-clicked it, and it took me directly to the error and highlighted it:

2025-08-25

SSMS Tips and Tricks 5-3: Using the XML editor and increasing the XML output size

Most people use SSMS to edit SQL queries. No big surprise there. The files will have a file type of .sql.

But what many people don’t understand is that SSMS inherits many of its underlying Visual Studio’s abilities to edit other document types.

For example, if you open a .txt text file, you can edit it just fine, and you can also include files like this in SSMS script projects. That can be useful for additional notes and documentation.

2025-08-23

SSMS Tips and Tricks 5-2: Viewing and configuring spatial data output

SQL Server 2008 added the ability to work with spatial data by the additional of the geometry and geography data types. When they first were added, there was no tools support for working with them, and all we had was direct manipulation of their internal binary storage.

Here’s an example:

I’ve defined a variable named @Shape of type GEOMETRY. I’ve then assigned a shape to it, based on a polygon formed by a set of points. If you look carefully, you’ll notice that it’s a square.

2025-08-21

SSMS Tips and Tricks 5-1: Changing the number of rows selected or edited in Object Explorer

When you right-click a table in SQL Server Management Studio, you get options for selecting or editing but the number of rows is limited:

Those values can be changed. By default, these numbers are both 200, but I’ve decided to change the default number of rows selected to 1000.

In Tools, Options, SQL Server Object Explorer, then Commands, you can set the values to whatever suits you:

I don’t tend to ever use the Edit option but I’d suggest not making it too large.

2025-08-19

SSMS Tips and Tricks 4-10: Using Activity Monitor

This is a quick tip but an important one. I see many people using SSMS and they aren’t aware of Activity Monitor.

While there are many clever things that we can do with queries, to interrogate the health of the system, don’t forget that there is quite a bit of useful information in Activity Monitor, and it’s easy to get to.

There are two basic ways to launch Activity Monitor. The first is to right-click the server in Object Explorer:

2025-08-17

SSMS Tips and Tricks 4-9: Setting SQLCMD mode for all new query windows

SQLCMD mode changes how queries are executed in SSMS. When using this mode, you can work with options that aren’t normally part of SQL Server T-SQL scripts.

Some installation scripts also require SQLCMD mode and will fail if it’s not enabled.

Let’s look at an example executing a query against 2 servers within the same script.

First, we open a new query window, then on the Query menu, we choose SQLCMD Mode.

2025-08-15