declare @StartDate date , @EndDate date select @StartDate = '20100101', @EndDate = '20100131'-- the above lines are to demonstrate this code without being a stored procedure-- remark out the following line to create the procedure, and then call it-- with your starting /ending dates.-- CREATE PROCEDURE dbo.AddDates (@StartDate date, @EndDate date) AS;WITH TENS (N) AS (SELECT 0 UNION ALL SELECT 0 UNION ALL SELECT 0 UNION ALL SELECT 0 UNION ALL SELECT 0 UNION ALL SELECT 0 UNION ALL SELECT 0 UNION ALL SELECT 0 UNION ALL SELECT 0 UNION ALL SELECT 0),THOUSANDS (N) AS (SELECT 1 FROM TENS t1 CROSS JOIN TENS t2 CROSS JOIN TENS t3),MILLIONS (N) AS (SELECT 1 FROM THOUSANDS t1 CROSS JOIN THOUSANDS t2),TALLY (N) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT 0)) FROM MILLIONS)select @StartDate UNION ALLselect dateadd(day, N, @StartDate) from Tally where N <= datediff(day, @STartDAte, @EndDate)