It seems that SQL 2005 does not support Table Variable Parameters in Stored Procedures.
See this article...
This would have been my preference (but alas, I have some SQL 2005 customers). And I guess I am not thrilled about the idea of a parameter table as sugested in this article.
Anyway, in this particular application I have a comma separated list of stock numbers (all integers) that I want to pass in to a stored procedure and then used them to join in a query in the stored proc. The number of stock numbers is not likely to exceed 20. Calling the proc 20 times is not an option since it is a heavy duty task.
I want something like this:
create procedure MyProc @StockNos varchar(5000)
Select * from myStockTable
where StockNo in (@StockNos)
but of course this doesn't work when you put a comma in @StockNos, you get error "Conversion failed when converting '48500,48482' to data type int."