title: Uniqueidentifier vs. IDENTITY vs. Material Code --which is the best choice for primary key?
body: <p><strong>Which one is the best choice for primary key in SQL Server?</strong><br>
  There are some example code:</p>
  
  <p><strong><a href="http://technet.microsoft.com/en-us/library/ms187942.aspx" rel="noreferrer">Uniqueidentifiers</a></strong></p>
  
  <p><strong>e.g.</strong></p>
  
  <pre><code>CREATE TABLE new_employees
     (employeeId   UNIQUEIDENTIFIER      DEFAULT NEWID(),
     fname      VARCHAR(20) )
  GO
  INSERT INTO new_employees(fname) VALUES ('Karin')
  GO
  </code></pre>
  
  <p><strong><a href="http://technet.microsoft.com/en-us/library/ms186775(v=sql.110).aspx" rel="noreferrer">Identity columns </a></strong></p>
  
  <p><strong>e.g.</strong></p>
  
  <pre><code> CREATE TABLE new_employees
   (
    employeeId int IDENTITY(1,1),
    fname varchar (20)
   );
  
   INSERT new_employees
      (fname)
   VALUES
      ('Karin');
  </code></pre>
  
  <p><strong>[Material Code](or Business Code,which identity of a material. e.g. customer identifier)</strong></p>
  
  <p><strong>e.g.</strong></p>
  
  <pre><code>CREATE TABLE new_employees(
      [ClientId] [varchar](20) NOT NULL,
      [fName] [varchar](20) NULL      
   )
  
   INSERT new_employees
      (ClientID, fname)
   VALUES
      ('C0101000001',--customer identifier，e.g.'C0101000001' a user-defined code.
       'Karin');
  </code></pre>
  
  <p>Please give me some advices for choosing the primary key from the three type identity columns,or other choices.</p>
  
  <p>Thanks!</p>