Execute query : Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints

I am connecting to mysql and when a execute the activity Execute Query I have the net error:

Execute query : Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

It’s a query from one table without joins. I have 4 tables and I only can do a select * from one table, the others return the above error.

I would understand this error if I had inserting data but not executing a query.

Thanks,

Hi jalbalat,

Does your table have any default value?
Default value can cause that error.
in my case, some columns had 0 and 0000-00-00 for default values and those zero values caused same error.

I suggest you to avoid using zero for default value.
If you can’t, then use IF statement to avoid print out zero default value.
It is bit of hassle but may solve your problem.

Sam

I had similar issue with executing query over ODBC to SQL Server 2016.
Error was:
Execute Query: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

The reason - MS SQL Table field was defined as nvarchar(max). Changing the type to nvarchar(4000) fixed the issue.