I hope someone can help me figure this out please...
I have this query that returns some student data - specifically the student's names, and some classes they're enroled in. What I'm trying to do is return multiple rows using the LIKE operator.
However when I run it and plug in the parameters I get the errror - "Error converting data type varchar to numeric". This error doesn't occur when there is only ONE studentId. Only when there are multiple studentIds. I know it's to do with the string of studentIds being passed, but I'm not sure how to fix it?
Should I be using varchar as the datatype to pass the studentIds? Or do I need to cast this as something else?
Any ideas, much appreciated.
@Fname varchar(50) OUTPUT,
@Lname varchar(50) OUTPUT,
@ClassName varchar (100) OUTPUT,
@ClassName2 varchar (100) OUTPUT,
@ClassName3 varchar (100) OUTPUT,
@ClassName4 varchar (100) OUTPUT,
@Class numeric OUTPUT,
@Class2 numeric OUTPUT,
@Class3 numeric OUTPUT,
@Class4 numeric OUTPUT
SET NOCOUNT ON;
@Fname = Fname, @Lname = Lname, @ClassName = C.ClassName, @ClassName2 = C2.ClassName, @ClassName3 = C3.ClassName, @ClassName4 = C4.ClassName,
View Complete Post