title: How to move data between multiple database's table while maintaining foreign-key relationships/referential integrity?
body: <p>I'm trying to figure out the best way to move/merge a couple tables of worth of data from multiple databases into one.  </p>
  
  <p>I have a schema similar to the following:</p>
  
  <pre><code>CREATE TABLE Products(
      ProductID int IDENTITY(1,1) NOT NULL,
      Name varchar(250) NOT NULL,
      Description varchar(1000) NOT NULL,
      ImageID int NULL
  )
  
  CREATE TABLE Images (
      ImageID int IDENTITY(1,1) NOT NULL,
      ImageData image NOT NULL
  )
  </code></pre>
  
  <p>With a foreign-key of the Products' ImageID to the Images' ImageID.</p>
  
  <p>So what's the best way to move the data contained within these table from multiple source databases into one destination database with the same schema.  My primary issue is maintaining the links between the products and their respective images.</p>