Click here to Skip to main content
15,884,237 members
Articles / Database Development / SQL Server / SQL Server 2008

Using Common Table Expressions and Recursion in SQL Server 2008

Rate me:
Please Sign up or sign in to vote.
4.50/5 (7 votes)
28 Apr 2010CPOL 16.2K   8  
By using recursion (and CROSS JOINS), you can generate data without looping or hard-coding INSERT statements into a temporary table.In the example below, you can use recursion to generate a week of scheduling data for three employees. -- Count variable, set to 7 for a week's worth of...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions