The Bit Bucket

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

SQL Interview: 74 Revoking permissions

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Security Level: Medium

Question:

Is it possible that revoking a permission can cause a user to be able to access a resource, when they previously could not?

If so, how?

Answer:

REVOKE can remove either a GRANT or a DENY. Revoking a DENY can cause a user to be able to access a resource that they previously could not.

2025-08-28

PG Down Under show 5 on using pgNow to optimize PostgreSQL with guest Grant Fritchey is published!

I had the pleasure of recording a new PG Down Under podcast last night. My guest was Grant Fritchey.

Grant has worked in IT for more than thirty years, as a developer and a DBA and I’ve known him for many of those years. Grant is known for his writing, as a Microsoft Data Platform MVP, and an AWS Community Builder.

Grant is a product evangelist with our friends at RedGate.

2025-08-27

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

PowerShell: New-Object : Constructor not found. Cannot find an appropriate constructor for type

This blog post is here so that I don’t forget it in future.

I’ve been writing Powershell again all day today and I spent ages trying to find this error when instantiating a particular object.

Bottom line is that there was a valid constructor that took a single string argument. However, I was passing an empty string to the constructor. I won’t tell you what I really think about that error message. Let’s just leave it at The error message returned is interesting.

2025-08-26

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

SQL Interview: 73 Orphaned users

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Medium

Question:

In SQL Server, what is an orphaned user?

How do users typically become orphaned?

Answer:

An orphaned user is one that appears in a database, but the server principal that they are linked to, does not exist.

2025-08-24

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

Book Review: Getting Started with Graph Query Language (GQL)

Another book that I recently received for review from my friends at PackT Publishing was Getting Started with Graph Query Language (GQL) by Ricky Gun, Jason Zhang, and Yuri Simione.

The subtitle is The complete guide to designing, querying, and managing graph databases with GQL.

I’ve worked with a number of graph-based databases over the years and I was interested to see where GQL is heading.

SQL Server Graph

In 2017, graph databases were all the rage, and so I wasn’t surprised when the SQL Server team decided to implement graph functionality within SQL Server.

2025-08-22

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