Copy the script and execute. You can change parameter values if you want.
2016-06-20
2,945 reads
Copy the script and execute. You can change parameter values if you want.
DECLARE @date datetime= '1900-01-30';
DECLARE @datetimeformat INT = 102;
--DECLARE @total_count INT = 10
SELECT 
    LTRIM(RTRIM(CONVERT(char(12), dateadd(day, D.number, @date), @datetimeformat))) As date
FROM
(
    select TOP 20
        CAST((row_number() OVER (ORDER BY (SELECT NULL)) -1) AS int) AS number
    FROM
        sys.all_columns AS AC
        CROSS APPLY
            sys.all_columns AS AC1
        CROSS APPLY
            sys.all_columns AS AC2
) D(number);