>>Ah, well I didn't mean to. I just copy and pasted in and it worked. Thanks
>>Tim
>>
>You're welcome. I will be curious if you can compare 3 versions of the query: your original and 2 versions I posted and tell me the execution plans and percentage.
>
>Put all 3 queries (after a correction to your original) into one sql script and run them
>
>set nocount on
>set statistics io on
>set statistics time on
>query 1
>query 2
>query 3
>
>
>and post the results as well as percentage of execution time from the actual execution plan.
Hi Naomi,
I doubt that would be useful as I only have test data plus this query pulls no more than a few records. I would be happy to do it however.
Now I do have a problem with the query that uses the function. I have this error.
Msg 156, Level 15, State 1, Procedure AppointmentsSelectByTutorsPlusStudentID, Line 19
Incorrect syntax near the keyword 'OR'.
With this SP
CREATE PROCEDURE [dbo].[AppointmentsSelectByTutorsPlusStudentID]
(
@TutorIDs varchar(500),
@StudentID char(5)
)
AS
BEGIN
SET NOCOUNT ON;
SELECT
AppointmentID,
TutorID,
Description
FROM [dbo].[Appointment]
WHERE
TutorID IN (SELECT Value from dbo.fnSplit(@TutorIDs, ',') OR
AppointmentID IN (SELECT AppointmentID FROM StudentAppointments WHERE StudentID = @StudentID)
END
Thanks
Tim
Timothy Bryan