while datepart(month,@input_date)=datepart(month,DATEADD(day,@counter,@input_date))beginselect datepart(year,DATEADD(day,@counter,@input_date)) as year, datepart(month,DATEADD(day,@counter,@input_date)) as Month, datepart(day,DATEADD(day,@counter,@input_date)) as DayInMonth, datename(month,DATEADD(day,@counter,@input_date)) as MonthName, datepart(weekday,DATEADD(day,@counter,@input_date)) as DayInWeek, datepart(week,DATEADD(day,@counter,@input_date)) as WeekNo, datepart(dayofyear,DATEADD(day,@counter,@input_date)) as DayInYearset @counter=@counter+1endGO