April 22, 2004 at 1:04 pm
I'm using SQL 7.0 and I'm trying to add a constraint but the DB is giving me an error saying that...
ALTER TABLE statement conflicted with TABLE CHECK constraint 'CN_EndingYearMustBeGTEStartingYear'. The conflict occurred in database 'MyTestDB', table 'Year'.
However, when I do sp_helpconstraint that constraint doesn't exist. Also, I've tried to drop that constraint and it insists that it doesn't exist. I've been adding a lot of constraints today so it's probably likely that I did add a constraint named that but then deleted it. Maybe somehow the DB hasn't recognized the delete. Is this a possible SQL 7.0 known bug or am I doing something wrong here? I am admittedly pretty new to constraint writing.
April 22, 2004 at 1:06 pm
Whoops, my fault. I realized right after I posted this question that the problem was that I had data already in my DB that didn't match the constraint criteria. I edited the "bad data" and ran the constraint again and it successfully completed. Sorry about that.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply