आप इस तरह पुनरावर्ती क्वेरी का उपयोग कर सकते हैं:
declare @intervalMinutes int = 10
declare @myDates table (
myId int primary key identity,
startTime datetime,
endTime datetime
)
DECLARE @startTime DATETIME = '2016-07-10 08:00'
DECLARE @endTime DATETIME = '2016-07-10 09:00'
;WITH CTE AS
(
SELECT @startTime st
UNION ALL
SELECT dateadd(MINUTE,@intervalMinutes,st) st
FROM cte
where dateadd(MINUTE,@intervalMinutes,st) < @endTime
)
INSERT INTO @myDates(startTime,endTime)
SELECT st,dateadd(MINUTE,@intervalMinutes,st) FROM cte
SELECT * FROm @myDates