Jonathan Roberts


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

975 reads

Technical Article

A DateRange Table Valued function

The function is an inline table-valued function (or sometimes called a parameterised view) so it can be used just like a view or a table but needs parameters. It generates a single-column table of datetime2 with rows differing by any multiple of any of the dateparts that SQL Server provides.

5 (6)

You rated this post out of 5. Change rating

2019-08-29 (first published: )

4,786 reads

Blogs

A New Word: Apolytus

By

apolytus– n. the moment you realize you are changing as a person, finally outgrowing...

Tired of Tedious SQL Queries? AI Tools Can Automate The Boring Parts

By

If you've ever wrestled with complex SQL code, you know the drill. Hours spent...

Check your regions people

By

Today I was having a nice discussion with some colleagues about Fabric and pricing/licensing...

Read the latest Blogs

Forums

Table Partitioning - remove null range

By goher2000

hi guys,   I have a partitioned table AM_ITM_INSTNC_MSS and I want to  get...

Principal owns a service?

By Brandie Tarvin

This is one I haven't seen before. I'm trying to drop a database user...

Issues backing up Analysis Services databases - silent failures

By Pete Bishop

I have a PowerShell script that I use to automate the backup of Analysis...

Visit the forum

Question of the Day

Read Only Replica in SQL Server Standard

Our environment runs using SQL Server Standard. We are implementing Availability groups. Our database has been experiencing high read volumes, so I want to let the application read the Synchronized Secondary replica, as I read that HADR does this. Can we implement this?

See possible answers