Tally Table

Technical Article

Create a Tally Function (fnTally)

  • Script

Many people have published high performance, read-less, Inline Table Valued functions that use Itzik Ben-Gan's wonderful "Virtual Numbers Table" to replace WHILE loops and other forms of RBAR. This one is Jeff Moden's version.

(8)

You rated this post out of 5. Change rating

2019-08-13 (first published: )

7,715 reads

SQLServerCentral Article

Tally OH! An Improved SQL 8K “CSV Splitter” Function

  • Article

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).

(189)

You rated this post out of 5. Change rating

2012-12-28 (first published: )

141,172 reads

Blogs

Learn Better: Pause to Review More

By

If you want to learn better, pause more in your learning to intentionally review.

Azure SQL Managed Instance Next-Gen: Bring on the IOPS

By

If you’ve used Azure SQL Managed Instance General Purpose, you know the drill: to...

SQL, MDX, DAX – the languages of data

By

Ramblings of a retired data architect Let me start by saying that I have...

Read the latest Blogs

Forums

Two foreign keys to the same table. Can't cascade deletes.

By FunkyDexter

Not sure if this is really a relational theory question but it seems about...

Connecting Power BI to SSAS and effective user not working

By Paul Hernández

Hi everyone, Below is a consolidated summary of what we validated Architecture & data...

High Availability setup - has anyone seen this method?

By Paul Lancaster

Hi all, I recently moved to a new employer who have their HA setup...

Visit the forum

Question of the Day

Encoding URLs

I have this data in a SQL Server 2025 table:

CREATE TABLE Response
( ResponseID INT NOT NULL CONSTRAINT ResponsePK PRIMARY KEY
, ResponseVal VARBINARY(5000)
)
GO
If I want to get a value from this table that I can add to a URL in a browser, which of these code items produces a result I can use?

See possible answers