Source Control for the Reluctant DBA
This is the 2nd post in the series named SQL Server and Continuous Integration. The previous post explained the problems I...
2016-07-13
936 reads
This is the 2nd post in the series named SQL Server and Continuous Integration. The previous post explained the problems I...
2016-07-13
936 reads
This is the 1st in a series of posts on SQL Server and Continuous Integration. Some of the tools I’ll be...
2016-07-07
762 reads
Triggers can be very useful when you want to log changes to your data, but what if you’re only interested...
2016-06-22 (first published: 2016-06-16)
2,382 reads
I know it sounds a bit odd but DELETE statements really do ignore table constraints. Running the code below in...
2016-06-03 (first published: 2016-05-30)
3,559 reads
Last month I wrote a post titled Broken Left Join which covered an easy to make mistake that I see...
2016-05-26 (first published: 2016-05-18)
1,805 reads
This month Wendy Pastrick is the host for T-SQL Tuesday #78. This month we have to “learn something new and blog...
2016-05-19 (first published: 2016-05-10)
3,502 reads
The SQL Server team is implementing an Incremental Servicing Model (ISM) to deliver updates for SQL Server. This is basically a...
2016-04-25
605 reads
Here is a simple example of a LEFT JOIN that returns the sales stats for all employees under 21.
SELECT e.Name,...
2016-04-21
579 reads
The ALTER TABLE..SWITCH command allows you to almost instantly move large amounts of data from one table to another. It does...
2016-04-20 (first published: 2016-04-12)
4,179 reads
Last week, I received an alert that the percentage of transaction log in use on one of our production databases...
2016-03-29
1,005 reads
By Steve Jones
Here are the resources for my talk at Day of Data Boston. Slides –...
By Steve Jones
I’ve covered the values in a number of previous posts on the Book of...
By Arun Sirpal
When the evidence names the database, it says so. When it doesn’t, it stops....
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