Using SQL Server 2008, I have a query that is used to create a view and I\'m trying to display a month\'s name instead of an integer.
SQL Server 2008
Without hitting db we can fetch all months name.
WITH CTE_Sample1 AS ( Select 0 as MonthNumber UNION ALL select MonthNumber+1 FROM CTE_Sample1 WHERE MonthNumber+1<12 ) Select DateName( month , DateAdd( month , MonthNumber ,0 ) ) from CTE_Sample1