Возможное решение:
set dateformat ymd
-- Sample data
declare @MyTable
table (room varchar(1), starttime varchar(4), endtime varchar(4), [date] datetime)
insert into @MyTable values ('1', '12pm', '1pm', '2018-02-18 00:00:00.000')
insert into @MyTable values ('1', '2pm', '3pm', '2018-02-18 00:00:00.000')
insert into @MyTable values ('1', '3pm', '5pm', '2018-02-18 00:00:00.000')
select d.[date], r.room, t.freehour
from
(select cast(dateadd(hour, number, 0) as time) as freehour
from master..spt_values where type = 'P' and number between 6 and 22) t,
(select distinct room from @MyTable) r,
(select distinct [date] as [date] from @MyTable) d
where not exists (
select 1
from @MyTable m
where m.[date] = d.[date]
and m.room = r.room
and t.freehour between cast(m.starttime as time)
and dateadd(hour,-1,cast(m.endtime as time))
)