Replication Latency
I've used Replication a lot over the years and contrary to the opinions of most DBA’s I know, I think it...
2013-01-25
2,124 reads
I've used Replication a lot over the years and contrary to the opinions of most DBA’s I know, I think it...
2013-01-25
2,124 reads
So, tomorrow marks one year since I started blogging here on SQL Server 365 and what a year it has...
2012-12-31
1,394 reads
I’ve done my fair share of work with Active Directory over the years and LDAP has helped immensely, it did...
2012-12-19
853 reads
As well as creating the script for yesterday’s post on finding Tables without a Clustered Index I tweaked the script...
2012-12-06 (first published: 2012-11-30)
5,266 reads
Yesterday while adding some new logic to an existing process I noticed an unacceptable level of performance degradation with the...
2012-11-29
1,552 reads
A sound indexing strategy is paramount to performance in an OLTP system. Not having the correct indexes in place can...
2012-11-27
2,570 reads
This week’s SQL Skills insider email contains a simple but often too true scenario regarding database mirroring. If you haven’t...
2012-11-21 (first published: 2012-11-14)
2,741 reads
I have been setting up multi instance database mirroring for the last couple of days along with some other DR...
2012-10-26
672 reads
I always try to enforce standards across all the SQL Servers I manage, it makes tons of administrative tasks much...
2012-09-21
1,384 reads
I recently stumbled across a little gem of a utility called tablediff. I have been working a lot with replication...
2012-09-20
6,775 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