title: Rename a stored procedure in SQL Server
body: <p>I'm attempting to rename a stored procedure in SQL Server 2008 with sp_rename system sproc. The third parameter is giving me difficulty though and I keep receiving the following error: </p>
  
  <pre><code>Msg 15249, Level 11, State 1, Procedure sp_rename, Line 75
  Error: Explicit @objtype 'P' is unrecognized.
  </code></pre>
  
  <p>As the message indicates I'm passing in a P for the value of the parameter. I call the sproc like this:</p>
  
  <pre><code>EXEC sp_rename @objName = @procName, @newname = @WrappedName, @objtype = 'P';
  </code></pre>
  
  <p>I double checked the documentation which says this is the value from sys.objects. I ran the following to double check I wasn't going crazy</p>
  
  <pre><code>select * from sys.objects where name = 'MySprocName'
  </code></pre>
  
  <p>and indeed the type returned is P. </p>
  
  <p>Does anyone know what I should pass here? I don't want to leave this empty since I'm creating a generic sproc to among other things rename arbitrary sprocs and if there is a name collision between a sproc and something else I don't want to have to worry about that.</p>