title: SQL Server - Generate unique ID to compare several columns altogether
body: <p>In SQL Server, is it possible to generate a GUID using a specific piece of data as an input value. For example,</p>
  
  <pre><code>DECLARE @seed1 VARCHAR(10) = 'Test'
  DECLARE @seed1 VARCHAR(10) = 'Testing'
  SELECT NEWID(@seed1) -- will always return the same output value
  SELECT NEWID(@seed2) -- will always return the same output value, and will be different to the example above
  </code></pre>
  
  <p>I know this completely goes against the point of GUIDs, in that the ID would not be unique. I'm looking for a way to detect duplicate records based on certain criteria (the @seed value).</p>
  
  <p>I've tried generating a <code>VARBINARY</code> string using the <code>HASHBYTES</code> function, however joining between tables using <code>VARBINARY</code> seems extremely slow. I'm hoping to find a similar alternative that is more efficient. </p>
  
  <p><strong>Edit</strong>: for more information on why I'm looking to achieve this.</p>
  
  <p>I'm looking for a fast and efficient way of detecting duplicate information that exists on two tables. For example, I have first name, last name &amp; email. When these are concatenated, should can be used to check whether these records eexists in table A and table B. </p>
  
  <p>Simply joining on these fields is possible and provides the correct result, however is quite slow. Therefore, I was hoping to find a way of <em>transforming</em> the data into something such as a GUID, which would make the joins much more efficient. </p>