WITH Date
AS ( SELECT CAST('2008-08-01' AS DATETIME) da
UNION ALL
SELECT da + 1
FROM Date
WHERE da < '2008-08-21'
)
SELECT CONVERT(VARCHAR, da, 23) AS c
FROM Date
ORDER BY da
WITH Temp
AS (
SELECT 1 [index], REPLACE(NEWID(), '-', '') as guid UNION ALL SELECT [index] + 1, REPLACE(NEWID(), '-', '') as guid
FROM Temp
WHERE [index] < 20
)
SELECT [index],guid
FROM Temp
ORDER BY [index]