In my DTSpackage, I have this to create a table...
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);
When I import a text file in to this table, I get the following error.
Error Source: Microsoft OLE DB Provider for SQL Server
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'.
I read online I can add to the create table portion
ALTER INDEX idxPRODUCTIVITY_PK on fwAIR.dbo.tblPRODUCTIVITY
SET (IGNORE_DUP_KEY = ON);
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.
I'm kinda lost from this point on getting rid of that error and having it continue on with the import.