Ssms-Tips-Tricks

SSMS Tips and Tricks 5-9: Closing idle connections

One challenge that I find with T-SQL is that there’s no 100% reliable way to drop a database.

I wish I was joking.

If you execute DROP DATABASE, the command will fail if anyone is connected to the database. The way that we normally drop databases is as follows:

USE master;
GO  

IF EXISTS (SELECT 1 FROM sys.databases AS d WHERE d.[name] = N'somedb')
BEGIN
    ALTER DATABASE somedb SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
    DROP DATABASE somedb;
END;

That mostly works, but the problem is that I need to execute the command from the master database. That means that when I set the database to single user, I don’t know that I’m the single user. What I’ve seen happen sometimes, is that the Intellisense system in SSMS is reading further down my script, where I’m perhaps recreating the database, and it’s maintaining a connection to the DB.

2025-10-14

SSMS Tips and Tricks 8-6: Using the PowerShell terminal

SSMS used to have a built-in web browser. That’s now gone.

What was added, though, is a Developer PowerShell window. On the View menu, you can choose Terminal.

This will then open a Developer PowerShell window:

Note that you can change the version of PowerShell that’s launched, from the drop-down. But the Settings option will take you to the Tools Options page where the Terminal can be configured.

2025-10-12

SSMS Tips and Tricks 8-5: Undock tabs and windows and using multiple screens

Like Visual Studio that it’s based upon, SSMS is very flexible when working with query windows and tabs.

Most people realize that you can undock and move tabs and windows around. Usually they discover that by accident and then realize that the Reset Window Layout option in the Window menu is helpful.

But one option I’ve found that many people don’t seem to realize is that you can undock just a single query window and move it outside the bounds of SSMS. You can even place it across on another screen if you have multiple screens.

2025-10-10

SSMS Tips and Tricks 8-4: Using document groups

In a previous post, I showed how you might use split windows to allow you to work on different parts of a single query at the same time.

But what if you need to work on two queries and see parts of both of them?

That’s where document groups can help you. You can create both vertical and horizontal groups. For me, the most useful is typically side-by-side vertically, for when I’m comparing two sections of code.

2025-10-08

SSMS Tips and Tricks 8-2: Resetting the window layout

One of the problems with applications that have highly-configurable user interfaces (UI) is that users can end up configuring them in ways they hadn’t intended, and then don’t know how to get back to where they were.

I remember the first time that I was at a session with a presenter from Microsoft showing the (at the time) new personalization options in ASP.NET. You could build a website and let the user determine how the site should be laid out, to suit themselves.

2025-10-04

SSMS Tips and Tricks 8-1: Using pinned tabs

When you get to a large number of query windows or other documents open as tabs in SSMS, it can start to be difficult to keep track of them, and to find them when needed.

It’s not too bad when you can immediately find the tab that you want in the drop-down list:

But if you have more tabs than are shown in this drop-down list or if, like me, you often end up with many of them without names (as they are temporary), it can get very hard to find the few that you are mainly referring to.

2025-10-02

SSMS Tips and Tricks 7-9: Connecting to Azure Storage

SSMS is a great tool for working with SQL Server relational databases but it can do much more than that.

In Object Explorer, note that you can easily connect to other types of services:

For a long time, it has been able to connect to Analysis Services to manage SSAS databases, both tabular and multi-dimensional. It can connect to Integration Services but that’s to the older style interface for SSIS. Nowadays, you should use the SSIS Catalog instead. There are a few items that you can configure via the Reporting Services connection as well.

2025-09-30

SSMS Tips and Tricks : Updated V3 eBook for 2025 released

SSMS is a great tool for working with SQL Server relational databases but it can do much more than that.

One of our most popular offerings is our SQL Server Management Studio Tips and Tricks eBook . And it’s just been updated to cover v21 of SSMS with our 2025 release.

It’s hard to describe how much work it has been to create this update, but we’re proud of the outcome and hope you’ll find it really interesting.

2025-09-29

SSMS Tips and Tricks 7-8: Starting faster by disabling CRL checking in constrained environments

If you have ever started SSMS in an isolated environment (ie: one with no external Internet connectivity), you’ll find that it’s slower to start.

That’s because SQL Server uses signed assemblies, and whenever an application with signed assemblies starts, it needs to check whether or not the certificate that they were signed with has been revoked. It’s not good enough to just check if it’s a valid certificate.

Certificates include a CRL (Certificate Revocation List) and this tells an application that’s trusting the certificate where to check for a list of revoked certificates.

2025-09-28

SSMS Tips and Tricks 7-7: Using script projects and solutions

I’m puzzled that so few people use script projects and solutions when working with SSMS.

They are easy to use. Let’s see an example:

Instead of just starting to create scripts, from the File menu, click New, then Project. You are greeted with the new Project dialog which also allows you to create a solution.

I’ve selected SQL Server Scripts as the project template and Next:

To get to the point faster, here’s one that I created earlier:

2025-09-26