title: Sybase complains of duplicate insertion where none exists
body: <p>I have moved some records from my SOURCE table in DB_1 into an ARCHIVE table in another DB_2 (ie. INSERTED the records from SOURCE into ARCHIVE and then DELETED the records from SOURCE.)</p>
  
  <p>My SOURCE table has the following index created as <code>SOURCE_1</code>:</p>
  
  <pre><code>CREATE UNIQUE NONCLUSTERED INDEX SOURCE_1
      ON dbo.SOURCE(TRADE_SET_ID, ORDER_ID)
  </code></pre>
  
  <p>The problem is - when I try to insert the rows back into SOURCE from ARCHIVE, Sybase throws the following error:</p>
  
  <pre><code>Attempt to insert duplicate key row in object 'SOURCE' with unique index 'SOURCE_1'
  </code></pre>
  
  <p>And, of course, subsequently fails the insertions.</p>
  
  <p>I confirmed that my SOURCE table does not have these duplicates because the following query returned empty:</p>
  
  <pre><code>select * from DB_1.dbo.SOURCE
  join DB_2.dbo.ARCHIVE
  on DB_1.dbo.SOURCE.TRADE_SET_ID = DB_2.dbo.ARCHIVE.TRADE_SET_ID
  AND DB_1.dbo.SOURCE.ORDER_ID = DB_2.dbo.ARCHIVE.ORDER_ID
  </code></pre>
  
  <p>If the above query returned nothing, then that means I haven not violated my unique index constraint on the 2 columns, however Sybase complains that I have.</p>
  
  <p>Does anyone have any ideas on why this is happening?</p>