title: Creating indexes with T-SQL returns index exists error
body: <p>What I'm trying to do is make a copy of a table using a SELECT INTO statement.</p>
  
  <p>After the table is created I want to duplicate the indexes as well.</p>
  
  <p>So the code I'm using is as follows:</p>
  
  <pre><code>SELECT * INTO TableCopy FROM Table
  </code></pre>
  
  <p>Then:</p>
  
  <pre><code>ALTER TABLE TableCopy ADD CONSTRAINT pkGUID PRIMARY KEY ([GUID])
  CREATE INDEX ixIndexName ON TableCopy (CountryCode)
  </code></pre>
  
  <p>When I execute the index SQL, I get an error that the indexes already exist in the catalog.  I didn't think index names had to be unique, I thought they could be duplicated across different tables.</p>
  
  <p>And lo and behold if I create the indexes through management studio, it accepts the index names.</p>
  
  <p>What am I missing here?</p>
  
  <p>Thanks.</p>