fark
11-17-2003, 09:54 AM
strsql="INSERT INTO tempUPS (PkgPrimary, m_packageId, m_weight, m_packageType, m_oversizeType, Sm_trackingNo ) IN 'C:\temp.mdb' SELECT m_primaryKey, m_packageId, m_weight, m_packageType, m_oversizeType, Sm_trackingNo FROM calPackage;"
How do I tell the INSERT INTO Statement to only insert the new record if it is unique. If I run this statement once I have 1000 if I run it twice I have 2000. I don't want duplicates to be inserted but when something is added to the source database that isn't in the destination I want the destination to have have the new records inserted. I thought about using update but that only updates the reccord it doesn't add a new one. I tried using DISTINCTROW with my INSERT INTO but then I get a syntax error. I set my indexing in the database not to accept duplicates but then it stops at the first duplicate with an error and doesn't add the new ones. I'm kinda stumped and don't know what to try next. Thanks for you help.
How do I tell the INSERT INTO Statement to only insert the new record if it is unique. If I run this statement once I have 1000 if I run it twice I have 2000. I don't want duplicates to be inserted but when something is added to the source database that isn't in the destination I want the destination to have have the new records inserted. I thought about using update but that only updates the reccord it doesn't add a new one. I tried using DISTINCTROW with my INSERT INTO but then I get a syntax error. I set my indexing in the database not to accept duplicates but then it stops at the first duplicate with an error and doesn't add the new ones. I'm kinda stumped and don't know what to try next. Thanks for you help.