title: How to ignore duplicate keys when extracting data using OPENQUERY while joining two tables?
body: <p>I am trying to insert records into MySQL database from a MS SQL Server using the "OPENQUERY"  but what I am trying to do is ignore the duplicate keys messages. so when the query run into a duplicate then ignore it and keep going.</p>
  
  <p>What ideas can I do to ignore the duplicates? </p>
  
  <p>Here is what I am doing:</p>
  
  <ol>
  <li>pulling records from MySQL using "OpenQuery" to define MySQL "A.record_id"</li>
  <li>Joining those records to records in MS SQL Server "with a specific criteria and not direct id" from here I find a new related "B.new_id" record identifier in SQL Server.</li>
  <li>I want to insert the found results into a new table in MySQL like so A.record_id, B.new_id Here in the new table I have A.record_id set as a primary key for that table.</li>
  </ol>
  
  <p>The problem is that when joining table A to Table B some times I find 2+ records into table B matching the criteria that I am looking for which causes the value A.record_id to 2+ times in my data set before inserting that into table A which causes the problem. Note I can use aggregate function to eliminate the records.</p>