SQL Puzzle 2: Eight Queens
This puzzle was first proposed in 1848 by a composer of chess puzzles called Max Bezzel and has since spawned...
2017-08-04 (first published: 2017-07-19)
2,209 reads
This puzzle was first proposed in 1848 by a composer of chess puzzles called Max Bezzel and has since spawned...
2017-08-04 (first published: 2017-07-19)
2,209 reads
Even though SQL Server automatically updates statistics in the background for you, you may find there are times when you...
2017-08-01
2,449 reads
T-SQL Tuesday
For T-SQL Tuesday this month Raul Gonzalez has asked us all to blog about lessons learnt the hard way:
http://www.sqldoubleg.com/2017/07/03/tsql2sday-92-lessons-learned-the-hard-way/
My...
2017-07-24 (first published: 2017-07-11)
9,358 reads
I was discussing Cardinality Estimation with a colleague recently and the question came up, what cardinality does SQL Server use...
2017-07-12 (first published: 2017-06-28)
2,891 reads
Statistics objects are important to us for allowing SQL to make good estimates of the row-counts involved in different parts...
2017-07-05
792 reads
Cardinality
This is a term originally from Mathematics, generally defined as “The number of objects in a given set or grouping”....
2017-06-30 (first published: 2017-06-20)
5,873 reads
In the last post we looked at using the STATISTICS IO and STATISTICS TIME commands to measure query performance.
If you’ve...
2017-06-14 (first published: 2017-05-31)
2,571 reads
What is an Index?
We often hear indexes explained using the analogy of an index in the back of a book....
2017-06-12
1,601 reads
Always Encrypted on SQL 2016 is pretty easy to set up. There’s even a single wizard to guide you through...
2017-06-09 (first published: 2017-05-30)
8,679 reads
When running workshops on the subject of SQL Query Performance the first question I always ask is how do we measure...
2017-06-08 (first published: 2017-05-24)
37,903 reads
By Steve Jones
I caught this interesting item over on Pinal Dave’s blog: Eleven Interview Questions that...
By Hemantgiri
I use color-coded connections in SSMS to distinguish Production, Pre-Production, UAT, and Development. But...
WhatsApp CS 628218520154 Jl. Suryopranoto No.40, RT.12/RW.7, Petojo Utara, Kecamatan Gambir, Kota Jakarta Pusat,...
WhatsApp CS 628218520154 Jl. Pegangsaan Timur No.1, Cikini, Kec. Menteng, Kota Jakarta Pusat, Daerah...
WhatsApp CS 628218520154 Jl. Pintu Air Raya No.36 Q, RT.6/RW.1, Ps. Baru, Kecamatan Sawah...
I have some data in a SQL Server 2025 database. It looks like this for the dbo.Customer table:
CustomerID CustomerName PreferredName 1 Steve Steve 2 Andy Andy 3 Brian Brian 4 Allan Allan 5 Devin Devin 6 Steve Steve 7 Sally SallyI want to detect which names have a single trailing space. The CustomerName is a varchar() and the PreferredName is a CHAR(). Does this query detect the problem rows?
SELECT
CustomerID,
CustomerName,
PreferredName
FROM Customer
WHERE CustomerName <> RTRIM(CustomerName)
OR PreferredName <> RTRIM(PreferredName); See possible answers