Keeping MS Docs Up to Date
One of the things that I like about the SQL Server docs (MS Learn Docs) is that I can fix things I find wrong. For years we had downloaded...
2026-01-09 (first published: 2025-12-10)
282 reads
One of the things that I like about the SQL Server docs (MS Learn Docs) is that I can fix things I find wrong. For years we had downloaded...
2026-01-09 (first published: 2025-12-10)
282 reads
For a number of years I have subscribed to Randy Franklin Smith's Patch Tuesday newsletter. It tends to hit my inbox in the wee hours of Wednesday.
2025-12-31 (first published: 2025-12-10)
282 reads
T-SQL Tuesday is a monthly blog party hosted by a different community member each month. This month, Mike Walsh
(blog) asks us:
Write two short notes to yourself. One to the...
2025-12-29 (first published: 2025-12-09)
259 reads
It has been a while since my last T-SQL Tuesday blog. When I saw Mike Walsh’s topic for T-SQL Tuesday #193, I was intrigued and inspired – “Notes to...
2025-12-24 (first published: 2025-12-09)
276 reads
The last T-SQL Tuesday of the year is hosted by my good friend Mike Walsh. Mike’s call for us is to end the year on a poignant note –...
2025-12-24 (first published: 2025-12-09)
187 reads
This month Mike Walsh hosts T-SQL Tuesday. It’s been quite some time since he hosted (back at #4), but he answered my call for hosts and I appreciate that....
2025-12-26 (first published: 2025-12-09)
256 reads
The setup My day job involves babysitting a lot of Git repositories hosted on GitHub. The vast majority of the commits, merges, and squashes I run on a daily...
2025-12-22 (first published: 2025-12-09)
522 reads
Recently, the world was reminded of just how fragile the internet can be. Two well established cloud services, Cloudflare and Azure Front Door, both had simultaneous outages that caused...
2025-12-22 (first published: 2025-12-08)
459 reads
In Parts 1-3, I covered how I prepare for a certification exam. In this last part, I'll talk about how I go about taking the exam.
2025-12-19 (first published: 2025-12-08)
477 reads
I was chatting with the product managers at Flyway and one asked me whether I’d seen the new tab for Automation in Flyway Desktop. I hadn’t and decided to...
2025-12-29 (first published: 2025-12-08)
195 reads
By Brian Kelley
I once kept a gratitude journal and I still have a task on my...
By Arun Sirpal
The goal is simple: register AgentDBA as an MCP server in Claude Code, so...
By Steve Jones
I was excited to try out the latest release of SSMS, v22.12.1 for this...
Hi everyone, We previously used the Microsoft Access Database Engine 2016 (ACE) provider. As...
Hello, We recently migrated a database from SQL Server 2014 to SQL Server 2022....
Comments posted to this topic are about the item Detecting Outliers in Power BI...
I have a few tables in my SQL 2025 database:
CREATE TABLE [dbo].[Customer] ( [CustomerID] [int] NOT NULL, [CustomerName] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [AddressKey] [int] NULL, [CustomerStatus] [int] NULL, [CustomerContact] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [ContactEmail] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [PreferredName] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[Customer] ADD CONSTRAINT [CustomerPK] PRIMARY KEY CLUSTERED ([CustomerID]) ON [PRIMARY] GO CREATE TABLE [dbo].[Orders] ( [OrderID] [int] NOT NULL, [CustomerID] [int] NOT NULL, [ProductID] [int] NOT NULL, [OrderDate] [date] NOT NULL, [Quantity] [int] NOT NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[Orders] ADD CONSTRAINT [PK__Orders__C3905BAFE0146D59] PRIMARY KEY CLUSTERED ([OrderID]) ON [PRIMARY] GO ALTER TABLE [dbo].[Orders] ADD CONSTRAINT [FK_Orders_Customers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[Customers] ([CustomerID]) GO ALTER TABLE [dbo].[Orders] ADD CONSTRAINT [FK_Orders_Products] FOREIGN KEY ([ProductID]) REFERENCES [dbo].[Products] ([ProductID]) GO CREATE TABLE dbo.CustomerReturn ( EntryID INT NOT NULL CONSTRAINT CustomerReturnPK PRIMARY KEY , CustomerID INT , ReturnDate DATETIME , OrderID INT NOT NULL ) GOThere are multiple rows in all these tables. I am trying to find how many customers have never returned anything, and I run this:
SELECT count(*)
FROM dbo.Customer
WHERE CustomerID NOT IN
(
SELECT CustomerID FROM dbo.CustomerReturn
);
I get zero rows, but I know there are customers who have not returned anything. What is wrong? See possible answers