title: SQL Server 2008 Check if an index exists
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/765867/list-of-all-index-index-columns-in-sql-server-db">List of all index &amp; index columns in SQL Server DB</a>  </p>
  </blockquote>
  
  
  
  <p>I would like to know if there is a way to verify if an index exists in a SQL Server database for a specific table based on the columns name:</p>
  
  <p>Let's say I run the following script:</p>
  
  <pre><code>  CREATE NONCLUSTERED INDEX [MyIndexName]
    ON [dbo].[MyTable] ([CustomerId])
    INCLUDE ([Id],[ModificationDate],[ProductId])
    GO
  </code></pre>
  
  <p>Now I would like to check if the index exists based on the table name and columns (and the columns in the include clause), not the actual index name.</p>
  
  <p>(SQL Server 2008 R2)</p>
  
  <p>Thanks</p>