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 use XML types. Here is a sample procedure:
CREATE PROCEDURE udsp_VariableParams(@params XML) AS BEGIN DECLARE @vdoc INT EXEC sp_xml_preparedocument @vdoc OUTPUT, @params SELECT * FROM OPENXML(@vdoc, '/params/param', 1) WITH ([paramname] VARCHAR(40), [paramvalue] VARCHAR(150)) EXEC sp_xml_removedocument @vdoc END EXEC udsp_VariableParams '' EXEC udsp_VariableParams ' '