I was creating a report using Microsoft Reporting Services when I ran across this error:
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
That’s not too terribly helpful, is it? So I went in search of something to make sense of this error. A Bing search took me to “Castner IT Blog” and there it was, bullet point number 1, the solution to my problem:
Check if you have changed the length of any fields in the underlying database table after creating the dataset. If you have, you may need to manually change them in the dataset as well. If you are using Visual Studio 2008, open the xsd file and click on the relevant field name. Ensure the maxlength property matches your new field length.
I had, in fact, updated the stored procedure used as a data source for that report, and that update had changed the maximum size of the data being returned.