Press "Enter" to skip to content

Generating a Series of Dates in SQL Server 2022

Hasan Savran won’t settle for just one date:

GENERATE_SERIES function is introduced in SQL Server 2022 version. It is a simple function that generates a series of numbers within a given interval. It requires compatibility level 160. 

The natural use for it is to generate a set of numbers, but as Hasan shows, you can easily turn that into a set of dates or dates and times.