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
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
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
…Need not Stay in Vegas Coming to Las Vegas in 2012 is an event many have been waiting for. Those that have been waiting for this event are the...
2011-09-14
14 reads
…Need not Stay in Vegas
Coming to Las Vegas in 2012 is an event many have been waiting for. Those that...
2011-09-14
752 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
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
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
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
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
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