>What is the proper way to pass a list of values via parameter to an IN operator? We have tried the following as a query in the management studio with no luck. The error message returned is as follows:
>
>Msg 102, Level 15, State 1, Line 3
>Incorrect syntax near ','.
>
>
>
>
>declare @joblist as varchar(100)
>
>set @joblist ='006291','006411'
>SELECT * FROM jcprod where cjobno in (@joblist)
>
>
>
>
>Thanks In Advance
>
>Jeff Hibbs
>The Blencowe Group
Hi Jeff,
JMWG, Try putting double quotes around the entire list.
>
>
>declare @joblist as varchar(100)
>
>set @joblist ="'006291','006411'"
>SELECT * FROM jcprod where cjobno in (@joblist)
>
>
HTH
Beth