From the course: Querying Microsoft SQL Server 2022

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Create a series of values

Create a series of values

- [Instructor] There is one more function that's brand new in SQL Server 2022 that I want to share with you. This is something that a lot of database professionals have been asking for for a very long time and that's the ability to generate a series of numbers. It may not seem like a big deal but previous solutions to get to this type of generated list has always been a hassle and it required a cumbersome set of functions and workarounds so it's really nice to bring that capability into a native function that's accessible to everyone. There is one catch though. In order to use this function, the database itself needs to be at a compatibility level of 160. This corresponds to the new SQL Server 2022 compatibility level. So if you have an older database, even if it's on a SQL Server 2022 server, it may not have been brought forward to fully support the current set of features. I've got the Generate series Start SQL file…

Contents