SQL Server 2022 introduced the GENERATE_SERIES()
function, which enables us to create a series of values within a given range. Although this function is limited to just numeric values, we can still combine it with various other functions to create a series of date/time values.
Below are examples of how we can use the GENERATE_SERIES()
function to help us get a list of all dates between two given date values.