Blog Post

PASS Summit 2019 in Photos

I took a bunch of photos at and around Summit this year, including more selfies than in years past - I’m getting better about it! For a few more...

2019-12-02

28 reads

Blog Post

ASF 027: Mikael Wedham interview

Introduction Mikael Wedham is the first Microsoft Certified Master on SQL Server 2008 in Sweden. He has worked as a developer and database administrator since 1993 and in ’97,...

2019-12-12 (first published: )

142 reads

Blog Post

PASS Summit 2019 Photowalk

This was my first year joining the Summit Photowalk organized by Jamie Wick (blog | twitter). I had a lot of fun - Seattle is full of great photo...

2019-11-29

15 reads

Woman in STEM award 2019!

gethynellis.com is proud to sponsor the Woman in STEM award at the Woman’s Business Club conference 2019! The Women in STEM award recognises the outstanding contributions of woman in...

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2019-12-13 (first published: )

199 reads

Blogs

Goodbye, Microsoft

By

A few years ago I took a new job at Microsoft, working as a...

The SUM of Nothing: #SQLNewBlogger

By

I caught this interesting item over on Pinal Dave’s blog: Eleven Interview Questions that...

How to Move the SSMS Status Bar to the Top and Color-Code SQL Server Connections

By

I use color-coded connections in SSMS to distinguish Production, Pre-Production, UAT, and Development. But...

Read the latest Blogs

Forums

Today's AI

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Today's AI

Split Large Queries in Athena with a Simple Modulo Trick

By Rahul Gupta

Comments posted to this topic are about the item Split Large Queries in Athena...

Finding Trailing Spaces

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Finding Trailing Spaces

Visit the forum

Question of the Day

Finding Trailing Spaces

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        Sally
I 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