WITH Dates AS ( SELECT [Date] = CONVERT(DATETIME,'1-1-2017') UNION ALL SELECT [Date] = DATEADD(DAY, 1, [Date]) FROM Dates WHERE Date < '12-31-2017' ) SELECT [Date] FROM Dates OPTION (MAXRECURSION 1000)
Work smarter, not harder.