Instead of regenerating it each time, I'd pregenerate it: two tables containing two columns: Month and Day, with a row for each day of the year (the second table is for leap years)
Then it's just a case of splitting the date into @MONTH and @YEAR, then using a simple SELECT on the correct table:
SELECT Day + '-' + Month + '-' + @YEAR FROM MonthNonLeapYear WHERE Month=@Month
Much more efficient than loops or CTEs and temporary tables.