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.FromLocatio nID <> StockTransport.ToLocationI D
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?
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.FromLocatio
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for your quick answer, could you point me towards a more specific solution to #2? Will increase points if so..