Forum Etiquette: How to post data/code on a forum to get the best help
Get correct answers to your SQL forum questions faster by making it easier to load your sample data and read your code.
2013-12-10 (first published: 2007-11-27)
220,843 reads
Get correct answers to your SQL forum questions faster by making it easier to load your sample data and read your code.
2013-12-10 (first published: 2007-11-27)
220,843 reads
Another in the series of articles to help you "fill in the cracks" in your T-SQL knowledge. MVP Jeff Moden shows us a super simple, high performance method to solve this timeless problem.
2013-07-19 (first published: 2011-01-20)
27,117 reads
The Tally Table has proven to be a simple and elegant method for avoiding many varieties of RBAR. Unfortunately, one of its more common uses, that of a CSV splitter, has a well-known and serious performance problem. MVP Jeff Moden shows us what that problem is and how to correct it. (UPDATED with additional info and attachments on 5/12/2011).
2012-12-28 (first published: 2011-05-02)
142,767 reads
In this sequel to his first "Hierarchies on Steroids" article, SQL Server MVP Jeff Moden shows us how to build a pre-aggregated table that will answer most of the questions that you could ask of a typical hierarchy. Any bets on whether Santa is packin’ a Tally Table in his bag or not?
2012-11-15
20,375 reads
Another in our series of articles to help you fill in the cracks in your knowledge with SQL Spackle. MVP Jeff Moden shows us how IsNumeric works and how you should use it.
2012-09-14 (first published: 2010-12-01)
44,483 reads
Replacing multiple spaces with a single space is an old problem that people use loops, functions, and/or Tally tables for. Here's a set based method from MVP Jeff Moden.
2012-08-17 (first published: 2009-11-16)
65,464 reads
Part two of this fantastic series from Jeff Moden looks at generating date data, something which can be handy for any number of testing purposes.
2012-04-25
8,417 reads
Learn how you can easily generate large amounts of test data efficiently in this new series from Jeff Moden. Part 1 covers integers and floating point values.
2012-03-26
11,745 reads
Revisiting his very popular article on the running total and ordinal rank problems, MVP Jeff Moden brings us a detailed analysis of how you might want to implement a solution in T-SQL.
2012-01-27 (first published: 2009-11-10)
48,479 reads
"Counting" is essential to many high performance code techniques. SQL Server MVP, Jeff Moden, shows us how to make sure that we're "Counting" and not "Crippling" our trick-code.
2011-08-08
23,225 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