title: Generating random string with T-SQL
body: <pre><code>DECLARE @tmp char(1) = '';
  SET @tmp = CAST(RAND()*26 AS int)+97;
  </code></pre>
  
  <p>This code doesn't work. The same expression with select works well:</p>
  
  <pre><code>SELECT CAST(RAND()*26 AS int)+97;
  </code></pre>
  
  <p>May be my @tmp is declared with a wrong data type?</p>