Einfache Lösung mit allgemeinem Tabellenausdruck. Vergleichen Sie mit der Cursorleistung, wenn Sie mindestens 1000 Zeilen haben.
create table #tmp (Dt datetime)
insert into #tmp values
('2015-07-15 15:01:21'),
('2015-07-15 15:17:44'),
('2015-07-15 15:17:53'),
('2015-07-15 15:18:34'),
('2015-07-15 15:21:41'),
('2015-07-15 15:58:12'),
('2015-07-15 15:59:12'),
('2015-07-15 16:05:12'),
('2015-07-15 17:02:12')
;with tbl as (
select dt, row_number() over(order by dt) rn
from #tmp
)
select t1.dt [from],t2.dt [to], datediff(minute,t1.dt,t2.dt) gap
from tbl t1
inner join tbl t2 on t1.rn+1 = t2.rn
where datediff(minute,t1.dt,t2.dt) >30