Following script is a quick and easy way to generate 10000 numbers . You can change the number to generate howmany ever numbers you want.
2013-09-17 (first published: 2013-09-06)
1,424 reads
sawmeonline,
2013-04-17 (first published: 2013-04-03)
Following script is a quick and easy way to generate 10000 numbers . You can change the number to generate howmany ever numbers you want.
WITH Number AS (SELECT 1 AS n UNION ALL SELECT n + 1 FROM Number WHERE n < 10000) SELECT n FROM Number OPTION ( MAXRECURSION 10000 );
Recursive CTEs can be confusing and scary, so examining some non-standard examples may cast light upon these shadowy demons.
"Counting" is essential to many high performance code techniques. SQL Server MVP, Jeff Moden, shows us how to make sure that we're "Counting" and not "Crippling" our trick-code.
Finding circular references that are stopping your CTE from working.
A Recursion function that was used to apply a Rate percentage to a base amount for the reqested number of times.