By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,419 Members | 1,609 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,419 IT Pros & Developers. It's quick & easy.

SQL Server passing a list of integers to a stored procedure

P: 3
I need to pass a list of integers to a stored procedure. When I place the following into the call to the procedure as @loglist = '123123,345345' and declare the variable in the stored procedure as
@loglist text,
then use the expression
AND E.Escalation_ID IN ('@loglist'),
I get an "operand type clash text is incompatible with int. If I take the single quotes out as in
E.Escalation_ID IN (@loglist),
I also get the same error.

Is there a way to CAST an entire list?
Nov 25 '08 #1
Share this Question
Share on Google+
1 Reply


100+
P: 142
You should use split function to split the the text into numbers. There are so many functions avalaible online to split a text delimited by comma. Pick the function, add it in your database and use it in your stored procedure to split and convert to numbers.
Nov 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.