• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 468
  • Last Modified:

passing a comma delimited list into sql server

I need to create a stored procedure that will take 2 dates and a comma delimited list as parameters.  For example  

Create Procedure Test  @date1 datetime, @date2 datetime, @stores varchar(300)

The parameters will come in like this:


In my stored proc I will need to say

 where store number in(the values passed in as @stores)

I won't know in advance what values are going to be passed in @stores.  

Does anyone know how to put the values passed into the In() function?

  • 2
1 Solution
Please look at this article by angelIII

Delimited list as parameter: what are the options?

There are several options detailed there.
sherbug1015Author Commented:
Great article.  Thanks.
Yes, it covers a lot of useful ground. Kudos goes to angelIII really.
Thanks for the grade. Cheers, Paul
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now