title: How to transfer data from one table to another 2 tables
body: <p>I am using sql-server 2008.</p>
  
  <p>I have 3 tables:</p>
  
  <pre><code>Item
    - Id
    - Name
  
  ItemLink
    - Id
    - FkParentItemId
    - FkChildItemId
  
  Item2
    - Id
    - FkItemId
    - Name
  </code></pre>
  
  <p>Relationships are:</p>
  
  <pre><code>ItemLink &gt;- Item -&lt; item2
           &gt;-
  </code></pre>
  
  <p>I now realise I have made a mistake and need to transfer data from "Item2" to "Item", but create  the hierarchy via inserting an ItemLink record. I do not wish to start a debate on the pros and cons of this approach, but just to add that there are common tables off "Item" that I need for "Item2"</p>
  
  <p>So I need a heads up on the insert ddl required to do this please. I believe it would be something along the lines of:</p>
  
  <pre><code>Insert into Item(Name) select(Item2.Name) from Item2
  Insert into ItemLink(FkParentItemId,FkChildItemId) select (Item2.FkItemId, New ItemId ??)
  </code></pre>
  
  <p>Bit rusty on this, hence the need for help.</p>
  
  <p>Many thanks in advance.</p>