title: Column names in each table must be unique. while copy table data from one table to another in sql server
body: <p>I have a table <code>Transaction_tbl</code> with these columns:</p>
  
  <pre><code>transactid   Tbarcode     dtime
  
  1            100          2013-04-16 14:15:47.243
  2            101          2013-05-10 10:15:47.243
  3            102          2014-02-20 02:15:48.000
  </code></pre>
  
  <p>In this table, <code>transactid</code> is the primary key.</p>
  
  <p>I have one more table <code>KHanger_tbl</code> with these columns:</p>
  
  <pre><code>transactid   Hbarcode
  1             21
  2             22
  3             23
  </code></pre>
  
  <p>in my <code>KHanger_tbl</code> this <code>transactid is the foregin key</code>  </p>
  
  <p>I want to move date range &lt;=2013-12-30 data from <code>Transaction</code> table to another table called <code>Transaction2013..</code>  (i mean data in the 2013)     </p>
  
  <p>The same time corresponding <code>Khanger_table</code> data need to move to table called <code>Khanger2013</code>  </p>
  
  <p>I am creating a new table while executing query ..</p>
  
  <p>First query  </p>
  
  <pre><code>select * into Transaction2013
  from Transaction_tbl
  where dtime &lt;='2013-12-30'
  </code></pre>
  
  <p>second query  </p>
  
  <pre><code>select * into Khanger2013
  from KHanger_tbl 
  inner join Transaction_tbl
  on Transaction_tbl.transactID=KHanger_tbl.transactid
  where Transaction_tbl.dtime &lt;='2013-12-30
  </code></pre>
  
  <p>but while executing the second query, I get an error:</p>
  
  <blockquote>
    <p>Column names in each table must be unique. Column name 'transactID' in table 'Khanger2013' is specified more than once.</p>
  </blockquote>