T-SQL Enhancement: Sequence
Many applications need sequentially incremental number as unique/primary key for records. SQL Server 2008 supports identity columns as the primary...
2011-06-07
549 reads
Many applications need sequentially incremental number as unique/primary key for records. SQL Server 2008 supports identity columns as the primary...
2011-06-07
549 reads
There was a question earlier on one of the SQL forums as to whether or not Ghost Cleanup overwrote the...
2011-06-07
1,892 reads
I spend a lot of time just looking at events, watching for new ideas. At our recent SQLRally we had...
2011-06-07
645 reads
Ah DTS packages…they suck. Seriously, it’s 2011. It’s been over a decade and we still have SQL 2000 and DTS...
2011-06-07
895 reads
If you were able to make it out to SQL Saturday in Pensacola this past weekend I want to say...
2011-06-07
644 reads
PASSMN has announced it’s June meeting. A little of the SQL and a little of the non-SQL. Get a brush...
2011-06-07
621 reads
I ran into an interesting question from someone asking for all combinations of numbers. The thread was here, and it...
2011-06-07
15,950 reads
In the next couple of weeks we’ll do a series of blog posts with some of the T-SQL enhancements that...
2011-06-07
466 reads
Yesterday I talked about the importance of having a tested business recovery plan. If you didn't read yesterday's post, the...
2011-06-07
970 reads
We have a table that contains just over 1.7 billion records and requires a daily feeding of around 9 million. It is split into 10, roughly equal, partitions. I...
2011-06-06
19 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