title: Using a hash as a primary key?
body: <p>I have a requirement to store the list of services for multiple computers. I thought I would create one table to hold a list of all possible tables, a table for all possible computers and then a table to link a service to a computer.</p>
  
  <p>I was thinking to keep the full services list unique, I could possibly use a hash of the executable as the primary key for the service, but i'm not sure if there would be any downsides to this (note that the hashing is only for identification. Not for any types of security purposes). I was thinking rather than using a binary field as the primary/foreign key, that I would store the value as a base 64 encoded sha512, and using an <code>nvarchar(88)</code>. Something similar to this:</p>
  
  <pre><code>CREATE TABLE Services
  (
    ServiceHash nvarchar(88) NOT NULL,
    ServiceName nvarchar(256) NOT NULL,
    ServiceDescription nvarchar(256),
    PRIMARY KEY (ServiceHash)
  )
  </code></pre>
  
  <p>Is there any inherent problems with this solution? (I will be using a SQL 2008 database and generally accessing it via C#.Net).</p>