Try This SELECT CAST('A' AS NVARCHAR(10)) AS Product,CAST(20.50 AS NUMERIC(18,2)) AS price,CAST(' 2014-08-10' AS DATETIME) AS initial_date, CAST('2014-10-01' AS DATETIME) AS final_date INTO #tempProductINSERT INTO #tempProduct (Product,price,initial_date,final_date) VALUES ('B',50,'2015-01-15','2015-02-20') SELECT * FROM master..spt_values WHERE type = 'P' SELECT Product,price,Dates FROM #tempProduct AS T inner join master..spt_values as N on N.number between 0 and datediff(MONTH, T.initial_date, T.final_date) cross apply (select dateadd(MONTH, N.number, T.initial_date)) as D(Dates)where N.type ='P' DROP TABLE #tempProduct
thanks Ravindra Prajapat