Pass in Dynamic number of parameters to a stored procedure

Posted by xrum on Stack Overflow See other posts from Stack Overflow or by xrum
Published on 2011-03-16T16:07:23Z Indexed on 2011/03/16 16:09 UTC
Read the original article Hit count: 159

Filed under:
|
|

Hi,

I have a function in my .NET application, that needs to do a search of an unknown number of parameters.

for example: select * from tbl where x=1 or x=2 or x=3 or x=4

is it possible to do in .NEt and SQL? how do i go about creating dynamic parameters in .NET (I was thinking doing it with a loop) but then how do i declare them in my stored procedure? does sql have arrays?

please help.

thank you!

© Stack Overflow or respective owner

Related posts about .NET

Related posts about sql