-- Collection of code snippets by Arne Vajhøj 
-- posted to eksperten.dk, usenet and other places (2002-now) 
SELECT n FROM (SELECT ROW_NUMBER() OVER (ORDER BY object_id) FROM sys.objects) x(n) WHERE n <= 50
GO

WITH x(n) AS (
    SELECT 1 UNION ALL
    SELECT 1 + n FROM x WHERE n < 50
)
SELECT n FROM x
OPTION (MAXRECURSION 50)
