title: How to Query to Find out if a Table has a CLUSTERED Primary Key
body: <p>I found this question, but it doesn't appear to answer the question...</p>
  
  <p><a href="https://stackoverflow.com/questions/7581508/sql-server-how-to-find-if-clustered-index-exists">SQL Server - How to find if clustered index exists</a></p>
  
  <p>How can I write an IF T-SQL statement to say:</p>
  
  <pre><code>IF NOT ([TableName] has a CLUSTERED PK)
     ALTER TABLE to add the CLUSTERED PK 
  </code></pre>