title: How to Generate Alphanumeric Random numbers using function in SQL Server 2008
body: <p>I need to generate alphanumeric random number with 6 character length and it should contain Numerics, Alphabets (Both Lowercase and Uppercase) check the query below.</p>
  
  <p><b>I NEED TO IMPLEMENT IN FUNCTION. (In function is it possible to use NEWID(), RAND()).</b></p>
  
  <pre><code>SELECT SUBSTRING(CONVERT(VARCHAR(255), NEWID()),0,7)
  </code></pre>
  
  <p><b>Output:</b></p>
  
  <pre><code>23647D
  06ABA9
  542191
  .
  .
  .
  </code></pre>
  
  <p><b>I Need Output as:</b></p>
  
  <pre><code>236m7D
  3n64iD
  6t4M7D
  .
  .
  .
  </code></pre>