Create this funtion and make sure you remember you have the function.It accepts two parameters and teh total range is same 2 billion or something in that neighbourhood.SELECT Number FROM dbo.GetNumbers(1, 50)SELECT Number FROM dbo.GetNumbers(1, 1000000)SELECT Number FROM dbo.GetNumbers(50000, 75000)CREATE FUNCTION [dbo].[GetNumbers]( @FromNum INT, @ToNum INT)RETURNS TABLEASRETURN WITH n0 AS (SELECT 1 AS p UNION ALL SELECT 1), n1 AS (SELECT 1 AS p FROM n0 AS a CROSS JOIN n0 AS b), n2 AS (SELECT 1 AS p FROM n1 AS a CROSS JOIN n1 AS b), n3 AS (SELECT 1 AS p FROM n2 AS a CROSS JOIN n2 AS b), n4 AS (SELECT 1 AS p FROM n3 AS a CROSS JOIN n3 AS b), n5 AS (SELECT 1 AS p FROM n4 AS a CROSS JOIN n4 AS b) SELECT @FromNum + n - 1 AS Number FROM ( SELECT TOP (@ToNum - @FromNum + 1) ROW_NUMBER() OVER (ORDER BY p) AS n FROM n5 ) AS d
N 56°04'39.26"E 12°55'05.63"