Watch: Kendra Breaks and Fixes SQL Source Control (9 minutes)
I love breaking technology. Well, I love breaking technology on purpose, in a place where it’s not going to slow anyone else down. It’s a great way to learn...
2019-03-04
24 reads
I love breaking technology. Well, I love breaking technology on purpose, in a place where it’s not going to slow anyone else down. It’s a great way to learn...
2019-03-04
24 reads
I’m excited to have just clicked ‘publish’ on four new videos in the brand new Evangelist Tutorials playlist on Redgate’s YouTube channel. These videos step through setting up and...
2019-02-15
34 reads
I’ve been working as an Evangelist at Redgate for close to six months now, and one question keeps coming up: what exactly does an Evangelist do at a software...
2019-01-29
36 reads
One controversial topic in database development is how to properly store and deploy database changes. This is generally described as choosing between two options, which are approximately as easy...
2019-01-23
36 reads
Jobs change over time, and database administrator jobs are no different. In this 35 minute recorded Twitch livestream (my first ever!) I talk about threats to DBA jobs and...
2019-01-18
28 reads
Next week, I’m giving a free webcast for Redgate on DevOps fundamentals. DevOps is something I am a big proponent of for database administrators, developers, and company leaders. The...
2019-01-17
26 reads
A magical thing happened this week in the SQL Community Slack (it’s free to join, by the way, sign up here). In the midst of a discussion about the...
2019-01-16
129 reads
I recently participated in a panel discussion for the SQL PASS DevOps virtual chapter. If you didn’t make the meeting, you can catch our 90 minute discussion here about...
2019-01-10
23 reads
I recently spoke at the GroupBy free online conference. It was loads of fun, and the recordings from the event are now available. Here’s the hour long session I...
2019-01-03
30 reads
There’s a lot of information out there on data breaches. I’ve written before about one source that I trust — the Verizon Data Breach Report (DBIR). The 2018 DBIR...
2019-01-02
27 reads
By Steve Jones
I’ve become an EV guy. I was talking with a friend who was selling...
In a previous post I talked about how we can use T-SQL Snapshot Backups...
By Steve Jones
A bit of a photo dump, but a few fun memories for me from...
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