DECLARE @Start_Date datetime
DECLARE @End_Date datetime
SET @Start_Date = '2017/01/01'
SET @End_Date = '2017/04/01'
DECLARE @DayTable TABLE (
Input_Date date not null primary key
)
DECLARE @Temp_Date DATE = @Start_Date
WHILE ( @Temp_Date <= @End_Date )
BEGIN
INSERT INTO @DayTable VALUES( @Temp_Date )
SELECT @Temp_Date = DATEADD(DAY, 1, @Temp_Date )
END
SELECT *
FROM @DayTable