Stored procedure with a variable number of parameters
-
Hi all, I need to know if this is possible, and if it is, whats would a stored proc like that look like. What I'm looking for is a query that the stored proc will run, which will like the following :
SELECT * FROM myTable WHERE ( SELECT COUNT(*) FROM myOtherTable WHERE (myOTID = @param1 OR myOTID = @param2 OR myOTID = @param3 OR [could me more ORs]) AND (myOtherTable.myID= myTable.myID) ) = 3
Any help would be much appreciated... Jubjub"If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders)
-
Hi all, I need to know if this is possible, and if it is, whats would a stored proc like that look like. What I'm looking for is a query that the stored proc will run, which will like the following :
SELECT * FROM myTable WHERE ( SELECT COUNT(*) FROM myOtherTable WHERE (myOTID = @param1 OR myOTID = @param2 OR myOTID = @param3 OR [could me more ORs]) AND (myOtherTable.myID= myTable.myID) ) = 3
Any help would be much appreciated... Jubjub"If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders)
Yes, it is possible. There are 3 ways to do this as mentioned here : Click Here[^]
Regards, Arun Kumar.A
-
Yes, it is possible. There are 3 ways to do this as mentioned here : Click Here[^]
Regards, Arun Kumar.A
Thanx arul, that helps a lot. That helps more than a lot. I tweaked the code that Mark J. Miller wrote in that article to suit my needs and it works a treat. I appreciate the help Arul. Looks like I have malfunctions with my web surfing abilities :). -- modified at 20:38 Saturday 2nd June, 2007
"If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders)