Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Problem Importing Data To Database Using SSIS

Posted on 2011-10-04
Medium Priority
Last Modified: 2013-11-05
I have several DTS packages that I am recreating using SSIS.  The source file is a flat file on a remote server.  The destination is into an existing database table.  This table has data in it already and I will be appending the new data to the existing data.  However, the following error occurs:

"The statement has been terminated.". An OLE DB record is available.  Source: "Microsoft OLE DB Provider for SQL Server"  Hresult: 0x80004005  Description: "Violation of PRIMARY KEY constraint 'C1249703'. Cannot insert duplicate key in object 'CA571L'.".

Can't figure this one out.  Please advise, need to resolve this as soon as possible.  Thank you very much in advance.
Question by:Tyecom

Accepted Solution

Molly Fagan earned 2000 total points
ID: 36913362
Are you working in a test environment with a copy of production data?  If that's the case and you're using a file that's already been processed, you're going to get a primary key violation error.

Author Closing Comment

ID: 36913398
Thank you for responding.  You are correct.  The data was already processed and I had to do some clean before processing them again.  Thank you very much.

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question