Monday Morning Mistakes: Connecting to Wrong Environments
Today’s Monday Morning Mistake issue is another painfully common one that we all run into at some point. You’ve got...
2012-06-18
2,337 reads
Today’s Monday Morning Mistake issue is another painfully common one that we all run into at some point. You’ve got...
2012-06-18
2,337 reads
Pragmatic Works has now released version 3.5 of the award-winning BIxPress software! For those not familiar with BIxPress it’s a...
2012-05-21
1,196 reads
You sure do got a 'purty motherboard...
Now that SQL Server 2012 is generally available to the public, many companies are...
2012-04-30
2,993 reads
This is just a quick post to remind folks who are current Microsoft MVPs that Pragmatic Works offers NFR licenses...
2012-04-23
1,100 reads
I just wrapped up my 24 Hours of PASS session on consolidation. A big THANK YOU again to everyone in attendance,...
2012-03-21
918 reads
Welcome back to another addition of Monday Morning Mistakes series. Today’s issue is one I tend to run into quite...
2012-03-12 (first published: 2012-02-28)
42,493 reads
SSIS Expressions
Expressions in SSIS are great. They allow you to create dynamic values for all sorts of stuff like variables,...
2012-02-16 (first published: 2012-02-13)
4,302 reads
Inspired by common emails and questions I see, I figured I’d do a series of blog posts on common mistakes...
2012-01-23
1,005 reads
I’m in the middle of a database migration and thought I’d quickly share a script I threw together to show...
2012-01-03 (first published: 2011-12-30)
82,697 reads
This week we’re going to talk about a topic that has been gaining steam in the last few years and...
2011-11-17
1,179 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...
WhatsApp:0817781222 Jl. Bina Insani No. 7G-7H, RT.003/RW.09, Kedung Jaya, Tanah Sareal, Kota Bogor, Jawa...
WhatsApp:0817781222 Jl. Kapten Muslihat No. 15 A, RT.01/RW.01, Pabaton, Kecamatan Bogor Tengah, Kota Bogor,...
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