1

I've the following table created:

CREATE TABLE [dbo].[DIM_PRODUCT](
    [product_id] [int] IDENTITY(1,1) NOT NULL,
    [product_name] [varchar](60) NOT NULL,
 CONSTRAINT [PK_DIM_PRODUCT] PRIMARY KEY CLUSTERED 
(
    [product_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]

Now, I'm using SSIS 14 in order to load data into Dimension Table. I'm just using two objects that extract the data from Staging Area (an OLE DB SOURCE) and load into Dimension Table (using and OLE DB DESTINATION).

For the product_name I'm looking for the corresponding field and for the product_id I'm putting ignore.

And I'm getting the following error:

[OLE DB Destination [35]] Error: There was an error with OLE DB Destination.Inputs[OLE DB Destination Input].Columns[PRODUCT] on OLE DB Destination.Inputs[OLE DB Destination Input]. The column status returned was: "The value violated the integrity constraints for the column.".

I know the error is because it trying to insert the ID as null and I try to avoid this issue checking the options: - Keep Identity - Keep Nulls

But I'm still getting this error...

Pedro Alves
  • 1,004
  • 1
  • 21
  • 47
  • What is your insert statement? Are you including the product_id column? If so you need to turn IDENTITY_INSERT ON for that table, temporarily. – Jacob H May 09 '17 at 14:05
  • no, I'm putting product_id column as ignore since I don't have "data" in SA to load to this column – Pedro Alves May 09 '17 at 14:09
  • 1
    Are you sure the column names are correct? They don't match your code and the error returned. – Jacob H May 09 '17 at 14:19
  • When you say you are 'putting ignore' what do you mean? You just don't map anything to the product_id column, then it should work. – Rich May 09 '17 at 14:39
  • @Rich yes 'putting ignore' means that I'm not mapping any column with product id... but it still gives me error – Pedro Alves May 09 '17 at 14:41
  • Worth a check on the product name size and its nullability. – Rich May 09 '17 at 14:45

0 Answers0