CREATE TABLE #yourTempTable([MonthName] VARCHAR(9), [Year] INT);WITH CTE(N) AS (SELECT 1 FROM (SELECT 1 UNION ALL SELECT 1)a(N)),CTE2(N) AS (SELECT 1 FROM CTE x CROSS JOIN CTE y),CTE3(N) AS (SELECT 1 FROM CTE2 x CROSS JOIN CTE2 y),TALLY(N) AS (SELECT 0 UNION ALL SELECT TOP 11 ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) FROM CTE3),DATETALLY(N) AS (SELECT DATEADD(month, DATEDIFF(month, 0, GETDATE())+N, 0) FROM TALLY)INSERT INTO #yourTempTableSELECT DATENAME(month,N), YEAR(N)FROM DATETALLY;SELECT *FROM #yourTempTable;

If exists (select 1 from information_schema.tables where table_name = 'Tally')drop table dbo.[Tally]GOCREATE TABLE dbo.Tally (N INT,CONSTRAINT PK_Tally_N PRIMARY KEY CLUSTERED (N))DECLARE @Counter INT SET @Counter = 0WHILE @Counter <= 10000 BEGIN INSERT INTO dbo.Tally (N) VALUES (@Counter)SET @Counter = @Counter + 1

SELECT DATEADD(month, DATEDIFF(month, 0, GETDATE())+N, 0) as N FROM TALLY

SELECT DATEDIFF(month, 0, GETDATE())+NFROM TALLY

select DATENAME(month,N), YEAR(N)FROM (SELECT DATEADD(month, DATEDIFF(month, 0, GETDATE())+N, 0) as N FROM TALLY) as a

SELECT Month=DATENAME(month, MyDate), Year=DATEPART(year, MyDate)FROM [master].dbo.spt_values TallyCROSS APPLY ( SELECT DATEADD(month, number-1, GETDATE())) a (MyDate)WHERE [Type] = 'P' AND Number BETWEEN 1 AND 12