Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. I get the above error message when I run the following code:SELECT cheq_id, cheq_daterec, cheq_pername, CAST(cheq_amt As decimal(9,2)) As cheq_amt, cheq_behalf, cheq_behalf1, cheq_behalf2, N.NatBusName, D.Dept_tdp, cheq_recpno, cheq_recpno1, cheq_recpno2FROM RecCheqs As CJOIN NatureBusiness AS NON N.NatBusID = C.cheq_natbus_idJOIN laintranet1.dbo.tblDepartment_tdpOLD AS D ON C.cheq_dept = D.DeptId_tdpWHERE cheq_DateRec >= coalesce(nullif(@DateFrom, ' '),cheq_DateRec) AND cheq_DateRec <= coalesce(nullif(@DateTo, ' '),cheq_DateRec)AND cheq_dept = coalesce(nullif(@Section , ' '),cheq_dept)AND cheq_office = @SdidORDER BY cheq_id
@Section could contain the value of 65, 67, or 69 between any of the dates. @Sdid could contain a string such as 'Tester'I get the Error message when the @Section value is a number of values between the 2 dates, but if the @Section values are all the same i.e. all 65 or all 67 then there is no Error, it seems to just be an error when there is more than 1 value for @Section.I have just started getting this error message and I don't know why?Any ideas ?