SQL Server stored procedure parameters
问题 I am developing a framework, where in I am a calling stored procedure with dynamically created parameters. I am building parameter collection at the runtime. The problem occurs when I am passing a parameter to stored procedure, but stored proc doesn't accept such parameter. For example, my stored procedure is: CREATE PROCEDURE GetTaskEvents @TaskName varchar(50) AS BEGIN -- SP Logic END Calling stored procedure as: EXEC GetTaskEvents @TaskName = 'TESTTASK', @ID = 2 This throws below error: