SQL Server Index Primer
Indexes 101: What, Why, and When? “What Is an Index?” I get this question a lot, especially from developers and sysadmins who’ve been handed a SQL Server and told,...
2025-05-12 (first published: 2025-04-23)
290 reads
Indexes 101: What, Why, and When? “What Is an Index?” I get this question a lot, especially from developers and sysadmins who’ve been handed a SQL Server and told,...
2025-05-12 (first published: 2025-04-23)
290 reads
I do believe most people know about the ability to backup your SQL server databases to URL (from Azure VMs). If you recall you would use the storage key...
2025-05-09 (first published: 2025-04-23)
390 reads
As AI continues to evolve, many of us are looking for ways to leverage large language models (LLMs) without relying on cloud services. As we learned in my previous...
2025-05-07 (first published: 2025-04-22)
596 reads
I was chatting with a customer recently and they wanted to know which host was sending in queries that were causing problems in real time. This post looks at...
2025-05-05 (first published: 2025-04-21)
540 reads
Yeah, yeah, second AI post in a row. I promise not to make a habit of it. But I saw someone else mention that you can feed them XML...
2025-05-07 (first published: 2025-04-21)
594 reads
In the intricate world of business, where precision and efficiency are paramount, managing database dependencies can often feel like navigating a labyrinth. Imagine having a tool that not only...
2025-05-05 (first published: 2025-04-21)
309 reads
immerensis – n. the maddening inability to understand the reasons why someone loves you – almost as if you’re selling them a used car that you know has a...
2025-04-18
81 reads
In this post, I will guide you on how to deploy a dockerized simple flask-based TODO application to Azure Container Apps using Pulumi. You will Dockerize the Python application,...
2025-04-18
106 reads
You can now run powerful LLMs like Llama 3.1 directly on your laptop using Ollama. There is no cloud, and there is no cost. Just install, pull a model,...
2025-05-02 (first published: 2025-04-17)
465 reads
Everything in SQL Server is waiting for something…this is by design. And most people never think about it… Until your application is waiting to complete its request, sell the...
2025-04-30 (first published: 2025-04-16)
417 reads
By James Serra
Microsoft shared another large set of announcements at Microsoft Ignite, held November 17–20 in...
By ReviewMyDB
Part 3 of my What's New in SQL Server for the Developer series. SQL...
By Brian Kelley
I once kept a gratitude journal and I still have a task on my...
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