Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameter and IN Operator
Message
De
27/11/2007 16:31:52
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
27/11/2007 16:06:20
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01271545
Message ID:
01271559
Vues:
14
AFAIK, you cannot do this. If I am wrong, please correct me.

Maybe you should look at passing in a CSV or XML list as a single VARCHAR parameter, parsing the values, putting them in a temporary table, and joining.

Wow, deja vu. I just typed this same response about 15 minutes ago.

>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
Very fitting: http://xkcd.com/386/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform