Scripts

Technical Article

User-Created GENERATE_SERIES() Function for Older SQL Server Versions

In the world of SQL Server, adaptation is key. While the built-in GENERATE_SERIES() function was a valuable addition in SQL Server 2022, its absence in older versions created a functionality gap. Enter the user-written GENERATE_SERIES function. Adapted from Jeff Moden's "dbo.fnTally", it offers an efficient means to generate a series of numbers within a defined range in older SQL Server versions. Its design mirrors the built-in function in SQL Server 2022, making the transition between versions as simple as removing the dbo. prefix. This forward-thinking design reflects the ingenuity of the SQL Server community, ensuring a seamless, efficient database migration experience.

You rated this post out of 5. Change rating

2023-06-26 (first published: )

2,600 reads

Blogs

The fundamental requirements of a reporting system

By

There are some fundamental boxes that your reporting system must tick. ✅ The figures...

Seeing the Bigger Picture: How A Monitoring Tool Changed My Approach to Estate Management

By

When it comes to managing complex database environments, having the right monitoring solution is...

A New Word: Foilsick

By

foilsick – adj. feeling ashamed after revealing a little too much of yourself to...

Read the latest Blogs

Forums

Create an HTML Report on the Status of SQL Server Agent Jobs

By Nisarg Upadhyay

Comments posted to this topic are about the item Create an HTML Report on...

The Last Good DBCC Run

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Last Good DBCC Run

count the number of NULLs in a row

By water490

Hi everyone I have a SP that finds the average based on 3 tables. ...

Visit the forum

Question of the Day

The Last Good DBCC Run

I want to check when DBCC CHECKDB was last run on my Baseball database. What code should I use?

See possible answers