DECLARE @SELECTMONTH NVARCHAR(7)=N'2017-02';
;
WITH MONTHDAYTABLE([DATE]) AS(
SELECT CONVERT(DATETIME,@SELECTMONTH+'-01')
UNION ALL
SELECT DATEADD(D,1,MONTHDAYTABLE.[DATE]) AS DATE
FROM MONTHDAYTABLE
WHERE DATEADD(D,1,MONTHDAYTABLE.[DATE])<DATEADD(MONTH,1,@SELECTMONTH+'-01')
)ab
SELECT * FROM MonthDayTable