Link to home
Start Free TrialLog in
Avatar of mdward4
mdward4

asked on

Pass Variable with multiple values separated by columns to stored procedure

I am needing to pass a variable into a stored procedure that is input by a user in this format:
76584,65433,78453

I then pass that to a stored procedure that looks it up like this:

Blah blah blah
Where Stock.PoolID = 1
And StockTransport.FromLocationID <> StockTransport.ToLocationID
And Stock.StockID in (@StockID) <---here---

I keep getting an error when running the sp, as it wont process the variable with the commas, but the query needs the commas to work.  Can anyone help?
SOLUTION
Avatar of nmcdermaid
nmcdermaid

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mdward4
mdward4

ASKER

ac,

thanks for your quick answer, could you point me towards a more specific solution to #2?  Will increase points if so..
I have not used that method in over five years But follow the link posted by nmcdermaid and you should get what you need.  Make sure to award them the points.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial