title: How to copy indexes from one table to another in SQL Server
body: <p>I need to copy the indexes from one table to another. There are a LOT of indexes and I don't want to recreate them from scratch. Seems error prone anyways.</p>
  
  <p>I have copied the structure using </p>
  
  <pre><code>SELECT * INTO [BackupTable] FROM [OriginalTable]
  </code></pre>
  
  <p>But that doesn't copy indexes, constraints, triggers etc</p>
  
  <p>Does anyone know how to do this?</p>