Breaking Rules in Rome
Last week I was honored with a trip to Rome for the Redgate President’s Club. I was awarded this, along with our top people in Sales, for the work...
2026-05-18
101 reads
Last week I was honored with a trip to Rome for the Redgate President’s Club. I was awarded this, along with our top people in Sales, for the work...
2026-05-18
101 reads
As part of my wider work exploring Claude Code and AI-assisted database engineering, I have been looking at how AI can support SQL Server operations. A failed job, missed...
2026-06-03 (first published: 2026-05-17)
558 reads
Train Wreck
The last time I watched a high school band nearly fall apart mid-performance was when the relatively new, certainly nervous band director started the piece off much faster...
2026-05-29 (first published: 2026-05-16)
228 reads
If you are considering any of the ISACA AI certs like the Advanced Artificial Intelligence Audit (AAIA) or the newly release Advanced Artificial Intelligence Risk (AAIR), ISACA will be...
2026-05-14
251 reads
Are you currently using Microsoft Fabric or considering migrating to it? If so, there are a couple of options to significantly reduce your monthly running costs. Firstly, there’s the...
2026-06-01 (first published: 2026-05-14)
386 reads
Track SQL Server Configuration Changes Using the Error Log
If you work with SQL Server long enough, you or someone will eventually want to know, “Did...
2026-05-29 (first published: 2026-05-14)
512 reads
Good documentation gets you started. Good books get you deep. After years of working with cloud data platforms, SQL engines, and machine learning pipelines, a handful of titles keep...
2026-05-22 (first published: 2026-05-13)
449 reads
In previous posts, we looked at the SQL Server engine. for us DBAs, the SSMS plays an important role for handling/Managing SQL Server. we have been using these tools...
2026-05-14 (first published: 2026-05-13)
69 reads
You have used Claude. But which Claude? The Claude app (claude.ai, the desktop and mobile apps) is the chat product you talk to. The Claude API is the developer...
2026-05-25 (first published: 2026-05-13)
619 reads
In the previous post we saw that even though we had done an exchange partition mid-flights through a query execution, the query kept on running to successful completion. The...
2026-05-13
269 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