I used SQL Server 2005 for my small web application. I Want pass parameters to SP . But there is one condition. number of parameter that can be change time to time. Think ,this
You can set the default values for the parameters at the SP level so that the parameters become optional.
e.g.
CREATE PROCEDURE dbo.Test
@param1 int, -- Not an optional
@param2 int = 10, --Optional
@param3 bit = 0, --Optional
@param4 varchar(50) = '', --Optional
@param5 nvarchar(100) = null --Optional
-- more parameters .....
AS
BEGIN
-- The SQL goes here...
END
Then you can populate the optional parameters at your choice.