Print all the months in T-Sql

This is a silly but probably usefull function in T-SQL, print all the months:

set language spanish
declare @counter int
set @counter = 0
while @counter

begin
set @counter = @counter + 1
print DateName( month , DateAdd( month , @counter , 0 ) - 1 )
end
Advertisements