Speaking at SQL Saturday #445 - Raleigh, NC - October 10
I will be speaking this weekend at SQL Saturday #445 - Raleigh, NC. If you are in the area, please come...
2015-10-07
498 reads
I will be speaking this weekend at SQL Saturday #445 - Raleigh, NC. If you are in the area, please come...
2015-10-07
498 reads
Have you ever called Microsoft Customer Support for help with a SQL Server performance issue? The engineer will typically send...
2015-07-21
1,565 reads
Recently, I ran into a critical error while I was helping a customer troubleshoot an issue in SQL Server. That...
2015-07-14 (first published: 2015-07-07)
29,685 reads
This past week I finally completed the 70-458 exam to upgrade my certification to MSCA: SQL Server 2012. I never...
2015-06-24
739 reads
Recently I’ve been learning more about how Azure functions and how it can help my customers. One of the best...
2015-04-28
1,129 reads
The year is 2015, and I’m still surprised by how many people have never heard of SQL Nexus; although it...
2015-03-10
1,715 reads
UPDATED: Don't just take my word. Read the feedback from others.
SQL Cruise Caribbean 2015: More Than A Cruise With Classes....
2015-02-24
1,145 reads
It’s been almost five months since I posted my last article, and so much has changed since then. I have...
2015-02-11 (first published: 2015-02-03)
6,585 reads
I promised that I would post the slide decks for my presentations, and now I have finally followed through on...
2015-02-02
699 reads
In some of my previous posts, I have talked about how to create Columnstore indexes. Now I’d like to discuss...
2014-08-21
2,358 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...
Hub/Cs 08218200233 Jl. Kyai Tamin No.110, Sukoharjo, Kec. Klojen, Kota Malang, Jawa Timur 65118
Telp/CS 08218200203 Jl. Kawi No.36, Gading Kasri, Kec. Klojen, Kota Malang, Jawa Timur 65116
Hi everyone, We previously used the Microsoft Access Database Engine 2016 (ACE) provider. As...
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