exec dbo.ct_lu_SurgeonList_WithConflictSearch
and it returned in less than 1 second. So now I'm wondering why SQL Server can return it so quick in QA, but not from within the application. I'd appreciate any idea's.>CREATE PROCEDURE ct_lu_SurgeonList_WithConflictSearch >@tiDept int, >@ttStart datetime > >as >set nocount on >SELECT t.lastname, t.firstname, t.coPerid, > /* This next line returns the room name > where the selected surgeon has a conflict */ > (SELECT Top 1 dbo.corooms.roomname > FROM dbo.meetings with (nolock) INNER JOIN > dbo.meetproc with (nolock) ON dbo.meetings.meetingnumber = dbo.meetproc.meetingnumber INNER JOIN > dbo.corooms with (nolock) ON dbo.meetings.roomid = dbo.corooms.roomid > where @ttStart between meetings.begintime and meetings.endtime > and meetproc.coperid=t.coPerID and isblock=0 and iscancelled=0) as RoomName, > isnull(t.isresident,0) as isResident, > isnull(t.issuspended,0) as isSuspended, > 0 as NumCancelled, > 0 as NumSched, > isnull((Select specdesc from dbo.coSpec with (nolock) where coSpec.specID=t.SpecID),' ') as specdesc >FROM dbo.coPer t with (nolock) >where EXISTS (select * > from dbo.coPerDept > WHERE dbo.coPerDept.deptid=@tiDept > AND dbo.coPerDept.coPerID=t.coperid) >and t.isactive=1 >and t.perTypeID=1 >order by t.lastname, t.firstname >