Posts

SDU Tools v26 is now available for download - added support for Fabric SQL Database

Just a heads-up that v26 of SDU Tools went out to SDU Insiders last week. If you haven’t used SDU Tools, they are just a large library of functions implemented in T-SQL. You can use them as a full library or use them as examples of code in work you are trying to do.

Fabric SQL Database Release

The main reason for this release (apart from the standard list updates for SQL Server versions, etc.) is to introduce a new target for SDU Tools. When you download v26, you’ll notice there are now three installation scripts, and three removal scripts. So, there are now versions for:

2025-09-30

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

SQL Interview: 82 Avoiding divide by zero errors

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: Development Level: Medium

Question:

You regularly execute the following query:

SELECT ProductID,
       UnitPrice / OuterPrice AS PriceRatio
FROM dbo.Products;

When OuterPrice is zero, an error is returned. What is the simplest way to change the query to return NULL for PriceRatio if OuterPrice is zero, without wrapping the expression in a CASE statement?

2025-09-29

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

Data Tales 7: The case of the database diet (Part 2)

This is the seventh tale in a series of stories about data. I hope you enjoy the series.

In the previous article I started discussing a large customer database that needed to go on a diet. We needed to drastically reduce the size of the database. I described why ROW compression was important, and showed how to estimate the savings from using it.

This month, we’ll start by looking at how ROW compression actually works, then look at the greater savings from PAGE compression. We’ll also look at how it works internally.

2025-09-27

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

SQL Interview: 81 COUNT(*) and COUNT(Column)

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: Development Level: Medium

Question:

You execute the following code:

DROP TABLE IF EXISTS dbo.Table1;
GO

CREATE TABLE dbo.Table1
(
    Column1 int NULL
);
GO

INSERT dbo.Table1 (Column1)
VALUES (1), (NULL), (NULL), (2);
GO

-- Query 1
SELECT COUNT(*), COUNT(Column1)
FROM dbo.Table1;

-- Query 2
SELECT COUNT(*), COUNT(Column1)
FROM dbo.Table1
WHERE Column1 = NULL;

What values will be returned for each query?

2025-09-25

Writing SQL Queries for Snowflake Online Course Released

Our courses on writing T-SQL queries for SQL Server and SQL for PostgreSQL have both been very popular. But we’ve had so many requests for a similar course targeting Snowflake, and we’ve delivered that now.

We’re pleased to announce that this course is now available, and it’s low cost. Just $95 USD. And because Snowflake is web-based, you don’t even need to install anything to do the course. You can find details of it here:

2025-09-25

SSMS Tips and Tricks 7-6: Running SSMS as another user

You don’t always want to run SSMS as your current login for Windows.

Now if all you want to do is to use a SQL Server login, then that’s easy. When you connect to a server in Object Explorer, or when you start a new Database Engine query, you can just choose SQL authentication instead.

But three other scenarios commonly occur.

If you need to run SSMS as an administrator on a machine with UAC, you can do this:

2025-09-24