467,915 Members | 1,265 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

SQL Server passing a list of integers to a stored procedure

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
  • viewed: 2980
1 Reply
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.

Similar topics

26 posts views Thread by David W. Fenton | last post: by
3 posts views Thread by jrogers.sw | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.