title: Unique ID base on other column
body: <pre><code>DROP TABLE #ABC
  CREATE TABLE #ABC (ID INT NOT NULL, Name VARCHAR (2) NOT NULL, name2 VARCHAR(2))
  INSERT INTO #ABC (ID, NAME)
  VALUES (1,'01'),(1,'F5'),(1,'05'),(1,'08'),(1,'02'), (1,'03'), (1,'04'), (1,'06'),(1,'07'),(1,'09'),(1,'10'),(1,'11'),(1,'12'),(1,'13'),(1,'14'),
  (1,'15'),(1,'2D'),(1,'2E'),(1,'4B'),(1,'5F'),(1,'64'),(1,'73'),(1,'83'),(1,'88'),(1,'A9'),(1,'AC'),(1,'D0'),(1,'D7'),(1,'15'),(2,'76'),(2,'J5')
  </code></pre>
  
  <p>Script I am using to populate name2 (not working)</p>
  
  <pre><code>UPDATE A
  SET name2 = SUBSTRING(REPLACE(CONVERT(VARCHAR(36), NEWID()) , '-', ''), 0, 3)
  FROM #ABC AS A
  
  select * from #ABC
  </code></pre>
  
  <p>So, I have table #ABC already populated with ID and NAME, I want to populate 'Name2' so that 'name2' should not have the same value as 'name' for the same ID. Example, for ID = 1 , all name2 values should be different than name values.
  Thanks </p>