title: Assign a unique id sql server
body: <p>I have a table that has the following records:</p>
  
  <pre><code>PatientId    PersonIdentifier
  1            abc
  2            abc
  3            def
  4            def
  5            def
  </code></pre>
  
  <p>I want to assign a personId that is numeric. So person identifier abc will both have Id 1 and def will all have Id 2. How do I do this?</p>
  
  <p>I've tried row num, rank etc, but can't seem to get it to work. </p>
  
  <p>Cheers</p>