• Is this a homework question? I ask because I answered something almost identical to this a couple of days ago (here). . .

    One way would be to do it like this: -

    DECLARE @date DATETIME, @number INT

    SET @date = '2011-06-06 00:00:00'

    SET @number = 12

    ;WITH CTE AS (

    SELECT 0 AS months

    UNION ALL

    SELECT months + 1

    FROM CTE

    WHERE months < @number-1)

    SELECT DATEADD(MONTH,months,@date)

    FROM CTE

    You would need to format the result as you require.


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/