title: SQL Server stored procedure parameters
body: <p>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. </p>
  
  <p>The problem occurs when I am passing a parameter to stored procedure, but stored proc doesn't accept such parameter.</p>
  
  <p>For example, my stored procedure is:</p>
  
  <pre><code>CREATE PROCEDURE GetTaskEvents
      @TaskName varchar(50)
  AS
  BEGIN
  -- SP Logic
  END
  </code></pre>
  
  <p>Calling stored procedure as:</p>
  
  <pre><code>EXEC GetTaskEvents @TaskName = 'TESTTASK', @ID = 2
  </code></pre>
  
  <p>This throws below error:</p>
  
  <pre><code>Msg 8144, Level 16, State 2, Procedure GetTaskEvents, Line 0
  Procedure or function GetTaskEvents has too many arguments specified.
  </code></pre>
  
  <p>This works fine in Sybase ASE, which simply ignores any additional parameters. Could this be achieved with MSSQL server 2008? Any help, much appreciated. Thanks</p>