Blog Post

Technical Dogma

Humans are creatures of habit, and I suspect that engineering/technical types are even more so. We find something that works...

2016-01-04

453 reads

Blog Post

Hidden GUI Gems

I have a few gems that are available to you in the GUI. These gems should help solidify your understanding of the tools available through the GUI to help...

2016-01-02

6 reads

Blog Post

Filtering Logged Data

Explore how to customize the view of the GUI for working with XEvent Log files or XEL files. This further customization does include working with filters.
Related Posts:

Get a List...

2016-01-01

31 reads

Blog Post

Filtering Logged Data

Over the course of the past couple of articles, I have shown some interesting if not useful functionality in the...

2016-01-07 (first published: )

1,232 reads

Blog Post

Fun with Operator Precedence

Let’s have some fun with operator precedence today. Specifically, logical operator precedence. Specifically, how is it evaluated when your where clause...

2016-01-06 (first published: )

2,819 reads

Blogs

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...

Architecting Zero Downtime Deployments–Day of Data Boston

By

Here are the resources for my talk at Day of Data Boston. Slides –...

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