कैसा कुछ ऐसा है
DECLARE @StartDate DATETIME = '05 Jan 2013',
@YearsAdded INT = 5
;WITH Dates AS (
SELECT @StartDate [Date]
UNION ALL
SELECT DATEADD(MONTH,1,[Date])
FROM Dates
WHERE DATEADD(MONTH,1,[Date]) <= DATEADD(YEAR,@YearsAdded,@StartDate)
)
SELECT *
FROM Dates
OPTION (MAXRECURSION 0)