SELECT a.num ,DATEADD(DAY,a.num-1,'20190101') AS ymd ,DATEPART(WEEK,DATEADD(DAY,a.num-1,'20190101')) AS week_no FROM ( SELECT ROW_NUMBER() OVER (ORDER BY column_name ) AS num FROM information_schema.columns ) a WHERE a.num < 366 ;