Another CTE based version
DECLARE @Month INT = 2, @Year INT = 2019
;WITH MonthDays_CTE(DayNum)
AS
(
SELECT DATEFROMPARTS(@Year, @Month, 1) AS DayNum
UNION ALL
SELECT DATEADD(DAY, 1, DayNum)
FROM MonthDays_CTE
WHERE DayNum < EOMONTH(DATEFROMPARTS(@Year, @Month, 1))
)
SELECT *
FROM MonthDays_CTE