Find Largest Tables To Compress
In this post I’m gong to show some T-SQL that will show you the compression state of tables and how to quickly find objects that are worth compressing.
Last...
2013-04-16
20 reads
In this post I’m gong to show some T-SQL that will show you the compression state of tables and how to quickly find objects that are worth compressing.
Last...
2013-04-16
20 reads
A 7th Cumulative Update is available for those users still on the RTM branch of SQL Server 2012. This is in keeping with Microsoft’s Incremental Service Modelling.
http://support.microsoft.com/kb/2823247You may have...
2013-04-16
23 reads
With Service Packs and Cumulative Updates rapidly released for SQL, it can be hard to keep up with what version you have installed where. It’s easy enough to find...
2013-04-09
25 reads
As part of theirIncremental Service Modelling , Microsoft have released SQL Server 2012 Service Pack 1 Cumulative Update #3.http://support.microsoft.com/kb/2812412
This CU contains 38 fixes and is pertinent for versions 11.0.3000...
2013-03-19
26 reads
One of the challenges we faced this week was a high CPU usage on one of our SSAS Cluster boxes when there was very little activity, plus some errors...
2013-01-21
24 reads
Hi all,
registration to attend SQL Bits is now open.
http://www.regonline.com/Register/Checkin.aspx?EventID=1163518
There’s a 600 capacity limit and they anticipate it to fill rather quickly. More details can be found here:
http://sqlbits.com/
Hope to see...
2013-01-11
18 reads
Previously I have blogged about how to check for free space in a database at a file level; a file for a database can be very large, but the...
2013-01-05
26 reads
Recently I have been supporting our move from TFS from 2010 to TFS 2012. The database instances is stored on a server that I do not have log on...
2013-01-03
20 reads
SQLBits XI has been announced for the 2-4th of May 2013. Having taken place in London this year, it is moving back North to the Midlands at the East...
2012-12-31
16 reads
Hello folks, welcome to a post focusing on one of the future features of SQL Server. SQL Server 2012 is barely a year old, yet there is already talk...
2012-12-30
30 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