Does a Primary Key always have stats_id 1?
Back to the SQL Server Basics with Wayne
The Myth
I recently was attending a presentation where the presenter stated that the...
2018-07-09 (first published: 2018-06-28)
2,443 reads
Back to the SQL Server Basics with Wayne
The Myth
I recently was attending a presentation where the presenter stated that the...
2018-07-09 (first published: 2018-06-28)
2,443 reads
SSMS is a wonderful tool. You can drag Windows around, grouped with others, split, docked, undocked, hidden… it seems endless...
2018-07-02 (first published: 2018-06-20)
4,795 reads
New SQL blogger
Jamie at the 45th Parallel (South) – New Zealand
This post is just a quick shout-out. My friend and co-leader...
2018-06-15
345 reads
Comparison of the new methods of splitting strings in SQL Server 2016 to the tried and true methods
2018-06-15 (first published: 2016-04-12)
9,520 reads
Killing Time – or removing the time element from a datetime
Over the course of time, we all collect scripts and routines...
2018-06-07
2,096 reads
One of the things that you will no doubt end up experiencing as a DBA is that you will see...
2018-05-16
2,011 reads
SSMS (and other SQL Server utilities) utilize a batch separator to, well, separate batches of T-SQL statements. Before we go...
2018-04-18
2,122 reads
Database Code Smells
I was recently reviewing a newly created T-SQL stored procedure. This procedure was verifying temporary table existence with...
2018-04-11
2,421 reads
This post talks about having primary replica jobs. That is, jobs that will only run on the primary replica of...
2018-04-02
1,015 reads
There are several different options available for working with tabs and spaces in SSMS. In fact, there are enough that...
2018-03-29 (first published: 2018-03-21)
2,954 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...
Comments posted to this topic are about the item Split Large Queries in Athena...
Comments posted to this topic are about the item 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 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