Friday, December 3, 2010

T-SQL Display Month Numbers and Names

SELECT Number + 1 as [Month Number],
DateName(mm,DATEADD(mm,Number,0)) as [Month Name]
FROM master..spt_values
WHERE Type = 'P' and Number < 12