Wednesday, August 19, 2009

The value violated the integrity constraints for the column.


I was trying to import data from one database server table to another database server table when I was getting this error message

SQL SSIS data import wizard error: "
The value violated the integrity constraints for the column.".(SQL Server Import and Export Wizard)"


After several times of troubleshooting to fix the problem and to import data successfuly I have noticed that there one was column in the source table which marked as "NULL" but the same colun in destination table was marked as "NOT NULL". Which caused the error.


Therefore what was happning ,some null value was getting inserted in NOT NULL column which SSIS does not allow and throws an exception saying integrity constraint would be violated.