title: force output param to not be tinyint?
body: <p>I just inherited a stored procedure as part of a system for inserting a new user.<br>
  At the top, <code>@user_id</code> is declared as <code>INT OUTPUT</code> and at the bottom <code>SET @user_id = @@IDENTITY</code>, which always returns zero for some reason. If I do:</p>
  
  <pre><code>select @@IDENTITY 
  </code></pre>
  
  <p>...I get something around '1872040'</p>
  
  <p>If I do:</p>
  
  <pre><code>SET @user_id = 187300  
  </code></pre>
  
  <p>...I get:</p>
  
  <blockquote>
    <p>Error converting data type int to smallint</p>
  </blockquote>
  
  <p>I also get the same if I do: </p>
  
  <pre><code>SET @user_id = CAST(@@IDENITY as INT)... 
  </code></pre>
  
  <p>It needs to be <code>SET @user_id = CAST(@@IDENITY as TINYINT)</code> or just<code>@user_id = @@IDENITY</code> for it to not give me errors. However, then it just returns null / 0.   So, I was googling around and couldn't really find an answer, is there a better way to force the output param to not be tinyint?  this is in ms sql. </p>