title: Violation of PRIMARY KEY constraint. Cannot duplicate key in object
body: <p>In my DTSpackage, I have this to create a table...</p>
  
  <pre><code>CREATE TABLE [fwAIR].[dbo].[tblPRODUCTIVITY] (
      [CMS_Login] varchar (5) NOT NULL, 
      [DeptIndex] tinyint NOT NULL, 
      [CMS_Date] datetime NOT NULL, 
      [AssociateNumber] int NULL, 
      [TotalCalls] smallint NULL, 
      [StaffTime] int NULL, 
      [ACDTime] int NULL, 
      [ACWTime] int NULL, 
      [PureAuxTime] int NULL, 
      [AuxInTime] int NULL, 
      [AuxOutTime] int NULL, 
      [HoldTime] int NULL, 
      [RingTime] int NULL, 
      [AvailableTime] int NULL, 
      [CallTime] int NULL, 
      [TotalNPTMinutes] smallint NULL, 
      [Active] char (1) NULL, 
      [iOther] int NULL, 
      [RcdCreateUser] varchar (15) NULL, 
      [RcdUpdtUser] varchar (15) NULL, 
      [RcdCreateDateTime] datetime NULL, 
      [RcdUpdtDateTime] datetime NULL,
      sdtImportDate smalldatetime NOT NULL DEFAULT GETDATE(),
      CONSTRAINT idxPRODUCTIVITY_PK PRIMARY KEY NONCLUSTERED (DeptIndex, CMS_Login, CMS_Date)
  );
  
  CREATE NONCLUSTERED INDEX idxPRODUCTIVITY
  ON tblPRODUCTIVITY (AssociateNumber, CMS_Date);
  
  CREATE CLUSTERED INDEX idxPRODUCTIVITY_DeptIndex_Date
  ON tblPRODUCTIVITY (DeptIndex, CMS_Date);
  </code></pre>
  
  <p>When I import a text file in to this table, I get the following error.</p>
  
  <blockquote>
    <p>Error Source: Microsoft OLE DB Provider for SQL Server</p>
    
    <p>Error Description: The take reported failure on execution. The
    Statement has been terminated. Violation of PRIMARY KEY constraint
    "idxProductivity_PK". Cannot insert duplicates key in object
    'tblProductivity'.</p>
  </blockquote>
  
  <p>I read online I can add to the create table portion</p>
  
  <pre><code>ALTER INDEX idxPRODUCTIVITY_PK on fwAIR.dbo.tblPRODUCTIVITY
  SET (IGNORE_DUP_KEY = ON);
  </code></pre>
  
  <p>But was told it wouldn't work and it would still error out.  I was told I can also "create mimic IX and added that option".  Which should work.</p>
  
  <p>I'm kinda lost from this point on getting rid of that error and having it continue on with the import.</p>