Integrity constraint violation
I have a database in SQL 7 (after doing a DTS from SQL 2000) and was trying
to enter some data into the database and I had this error message.
ODBC Error Code = 23000 (Integrity constraint violation)
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL
into column 'Question01UIN', table
'wwtbamsgcom_db1.wwtbamsgcom_db1.Question01Main'; column does not allow
nulls. INSERT fails.
The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (9:1) to (9:113).
That column Question01Main does not expect a
null value to be entered. The existing columns have values in there. I do
not know why the data entry now tries to insert a null value into the
column, which will be rejected as we can see.
someone perhaps point out what went wrong please? Thanks!
Did you get the error during DTS or later?
If during DTS, make sure that the source and target columns are mapped correctly, sometimes DTS may assume things.
If you are getting this error after completing DTS while trying to insert a new row, then check the insert statement to see if you are not missing any column data before this particular column.