Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 dynamic numbers of parameters

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-11-19 : 10:44:08
Stefan writes "Is it possible to create a stored procedure that, depending on one parameter(that contains a number), create other parameters that will be used inside of the sp?

ie.
I want to call my sp like this (I'm working in asp/asp.net):

numberofparam = 3
var1 = "bla"
var2 = "bla2"
var3 = "bla3"

sp_name " & numberofParam & ", " & var1 & ", " & var2 & ", " &var3

---------------------------------------------
This is the way I'd like my sp to work:

CREATE PROCEDURE spViewSubscription2
{
@numberofParam int (2)
if @numberofParam > 1
for i = 1 to @numberofparam
@Param + i
end loop
}

kindly regards
-Stefan-"
   

- Advertisement -