title: Does any different between UNIQUE NONCLUSTERED INDEX and NONCLUSTERED INDEX
body: <p>I am using SQL Server 2008 R2 and this index in my database was already created:</p>
  
  <pre><code>CREATE UNIQUE NONCLUSTERED INDEX IndexT1 
  ON T1 (
      [ID] ASC,
      [logID] ASC
  )
  INCLUDE ([MasterID]) 
  WHERE ([logID] IS NOT NULL)
  </code></pre>
  
  <p>I executed this query :</p>
  
  <pre><code>SELECT 
      R.X 
  FROM
      R
  LEFT JOIN 
      T1 ON T1.MasterID = R.MasterID
  WHERE 
      T1.ID IS NULL 
      AND R.logID IS NULL
      AND T1.ItemID IN (SELECT MAX(R.ItemID)
                        FROM R
                        LEFT JOIN T1 ON T1.MasterID = R.MasterID
                        WHERE T1.ID IS NULL 
                          AND R.logID IS NULL
                        GROUP BY R.MasterID)  
  </code></pre>
  
  <p>And in the execution plan, SQL Server offer to me to create this index:</p>
  
  <pre><code>CREATE NONCLUSTERED INDEX [&lt;Name of Missing Index, sysname,&gt;]
  ON T1 (
    [ID],
    [logID]
  )
  </code></pre>
  
  <p>Does anybody know what is a difference between those indexes?</p>
  
  <p>Because, I think the first ones cover the second ones! Why my query can not use the first ones?</p>