locked
Finding a Constraint Violation RRS feed

  • Question

  • I am working on a Website Project (unfortunately not a Web Application Project). While debugging, I get the following error:

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

    The line that the error points to, however, is a method that uses an SQL Server Stored Procedure that just uses a SELECT statement, so it is not adding any new data to the database. I have spent several days trying to find the problem, but no success. Is there any way to get SQL Server to give me a little more detail about what table and/or fields' constraints are being violated, what stored procedure is doing the violating, and/or the value that violates them? Thanks.


    Nathan Sokalski
    njsokalski@hotmail.com
    http://www.nathansokalski.com/


    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
    Thursday, August 12, 2010 5:43 PM

Answers

  • I do remember this exact problem discussed on ASP.NET forums website, although I don't remember if there was any resolution. Here is a topic in that forum http://forums.asp.net/p/1445339/3284670.aspx#3284670
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog
    • Marked as answer by KJian_ Thursday, August 19, 2010 9:01 AM
    Thursday, August 12, 2010 5:45 PM
  • A discussion of this topic can be found at

    http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/27aec612-5ca4-41ba-80d6-0204893fdcd1

    While you are on that page, you will see several other threads on the same topic in the Related Topics sidebar.

    One important point is this is not a SQL Server error, it is an error on the front end.

    Tom

    • Marked as answer by KJian_ Thursday, August 19, 2010 9:01 AM
    Thursday, August 12, 2010 6:01 PM

All replies

  • I do remember this exact problem discussed on ASP.NET forums website, although I don't remember if there was any resolution. Here is a topic in that forum http://forums.asp.net/p/1445339/3284670.aspx#3284670
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog
    • Marked as answer by KJian_ Thursday, August 19, 2010 9:01 AM
    Thursday, August 12, 2010 5:45 PM
  • A discussion of this topic can be found at

    http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/27aec612-5ca4-41ba-80d6-0204893fdcd1

    While you are on that page, you will see several other threads on the same topic in the Related Topics sidebar.

    One important point is this is not a SQL Server error, it is an error on the front end.

    Tom

    • Marked as answer by KJian_ Thursday, August 19, 2010 9:01 AM
    Thursday, August 12, 2010 6:01 PM