SQL Puzzle 1: Magic Squares
This is the first in what I hope will be a semi-regular series of recreational puzzles where SQL can be...
2017-06-07
1,653 reads
This is the first in what I hope will be a semi-regular series of recreational puzzles where SQL can be...
2017-06-07
1,653 reads
In this post we’re going to create some encrypted columns in a table in a test database and look at...
2017-06-06
11,126 reads
Parallelism and MAXDOP
There’s no doubt that parallelism in SQL is a great thing. It enables large queries to share the...
2017-05-26
5,337 reads
A lot has been written about the change of licencing in SQL 2016 SP1. Here's my two-pence worth.
2017-05-17
20 reads
A small change, but a great one, in SQL 2016 is native support for splitting strings.
This has to be about...
2017-05-09
786 reads
Thoughts on how to think about parallelism in SQL Server - and how to tune it.
2017-04-18
21 reads
In this post we’re going to create some encrypted columns in a table in a test database and look at some of the practicalities and limitations of working with...
2017-04-10
14 reads
This post attempts to explain in simple terms what keys are involved in Always Encrypted, how they get used, and the implications of those facts.
2017-04-03
14 reads
This is a quickie post to introduce the new DBCC command CLONEDATABASE.
Okay so this isn’t technically a SQL Server 2016...
2017-03-31 (first published: 2017-03-20)
2,372 reads
Query Store was, probably without doubt, the most anticipated and talked out new feature in SQL 2016. Certainly by the...
2017-03-29 (first published: 2017-03-13)
6,387 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