Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with speed issue
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00940635
Message ID:
00941228
Views:
17
Improvement found:

I took this first subquery out and turned it into a function:
  (select count(meetingnumber) from dbo.meetings
	where (begintime between det.StartTime and dateadd(mi,@iLength,det.StartTime)
        or     endtime   between det.StartTime and dateadd(mi,@iLength,det.StartTime)
        	or det.StartTime between begintime and endtime
        	or dateadd(mi,@ilength,det.StartTime) between begintime and endtime)
        	and iscancelled=0 and roomid = det.RoomID ) as RoomConflict,
and called the function instead and it works again.

Kirk
Previous
Reply
Map
View

Click here to load this message in the networking platform