Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid Column Name error
Message
From
11/11/2010 10:16:18
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01488773
Message ID:
01488817
Views:
31
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform