SELECT COUNT(*) vs COUNT(1) vs COUNT(ColumnName)
What is the difference between COUNT(*), COUNT(1) and COUNT(ColumnName)? A mystery that will never be known… ok that was a...
2011-09-15
13,153 reads
What is the difference between COUNT(*), COUNT(1) and COUNT(ColumnName)? A mystery that will never be known… ok that was a...
2011-09-15
13,153 reads
All ColoradoSQL user group meetings start at 5:30 p.m. and provide food and refreshments. There is no cost to attend...
2011-09-14
593 reads
It was a normal Monday. I was going over some HA designs and planning the joys of setting up log...
2011-09-14
2,337 reads
I wanted to write this because lately I say “I don’t know” a couple times a day to my client/boss....
2011-09-14
633 reads
This is a technique I’m sure many people are already using in their environments. Instead of using the actual name...
2011-09-14
3,624 reads
With a late cancellation with one of our speakers a hole was opened on our speaker lineup. I reached out...
2011-09-14
431 reads
There's nothing more I love than free food and SQL Server, no joke. I take my free food and SQL...
2011-09-14
533 reads
With CTP3 for SQL Server Denali available, a lot of us want to play with all the new cool features, as well as...
2011-09-14
1,741 reads
SQL Server 2011 “Denali” CTP3 introduced couple of new Dynamic Management Views (DMV). However, documentation says that some of them...
2011-09-14
746 reads
With CTP3 for SQL Server 2012 (code name of “Denali”) available, a lot of us want to play with all the new...
2011-09-14
1,659 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