title: Could not find stored procedure ' '. SQL Server 2008
body: <p>I have created a stored procedure and am receiving the following error when trying to call it using an exec 'procedure_name' statement. The procedure has a chunk of static SQL code in the first half and then dynamic code for the last half...</p>
  
  <pre><code>calcNums(Param1, Param2, etc...)
  --------
  DECLARE a bunch of variables
  --------
  
  STATIC CODE here
  
  -------
  SET @SQL = DYNAMIC CODE
  
  EXEC @SQL
  </code></pre>
  
  <p>I have the right database connection selected and I created the procedure with the dbo. schema prefix. </p>
  
  <p>If I call the procedure without any parameters then I get an error of...</p>
  
  <blockquote>
    <p>Procedure or function 'calcNums' expects parameter 'Param1' which was not supplied.</p>
  </blockquote>
  
  <p>Otherwise it gives me the error...</p>
  
  <pre><code>Could not find stored procedure ' '.
  </code></pre>
  
  <p>Can anyone give me an idea as to why I am getting this error?</p>