Natural vs Artificial Primary Keys
There has been a long standing debate over the use of a natural primary key vs an artificial one. I...
2016-08-29
1,290 reads
There has been a long standing debate over the use of a natural primary key vs an artificial one. I...
2016-08-29
1,290 reads
Index Utilization Report
One day my manager came and told me that he need Index Utilization Report.
He felt that during...
2016-08-29
576 reads
The SQL Server whenever it restarts all the databases goes into the recovery mode. In this state the database comes...
2016-08-29
11,804 reads
Remote server management is a fact of life for folks involved with sql server. Since we work so often with...
2016-08-29
181 reads
I love to speak about PowerShell. I really enjoy giving presentations and when I saw Start-Demo being used at the...
2016-08-29
544 reads
Remote server management is a fact of life for folks involved with sql server. Since we work so often with...
2016-08-29
666 reads
I am happy to share that the newest release of the CISL (Columnstore Indexes Script Library) – 1.3.1 is live!
Do...
2016-08-28
607 reads
If I had a dollar for every CTE solution to a simple query in the forums (pick any SQL forum), I’d...
2016-08-27
779 reads
Overview
There are multiple numbers states of a SQL Database. These states determine the current status or mode of database in...
2016-08-27
551 reads
To kick off this series, I thought it would be worthwhile to discuss why it is I step up to...
2016-08-26
444 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