-- Collection of code snippets by Arne Vajhøj 
-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and 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)
