• Using a recursive CTE to generate what is basically a dynamic tally table except returning a dynamic calendar/time table is not scalable.

    For an article on dynamic tally tables, please read this one: The Dynamic Tally or Numbers Table[/url].

    You can easily modify it to meet your needs as detailed in the article, and it will be much more scalable as it won't be using the RBAR approach inherent in recursive CTE's.