Unanswered: force check constraint to occure every update?
I have a check constraint on my table, but it doesn't block my updates. I have 2 tables, Files and details. There is a 1 to many relationship between these tables, and I have a user defined function that tests if the file is closed. the details table has a checkConstraint that calls the function, sending in the file number. This works great to prevent adding lines to a closed file, and I have a INSTEAD OF DELETE trigger to prevent deleting from a closed file, but unless I update the file number, I can still update a record. Any idea as to how I can force this CHECK CONSTRAINT to fire every time I update the table? I know I could rewrite it to a INSTEAD OF UPDATE trigger, but from what I read I would have much better performance using a constraint.
Once again, the problem is that I have a constraint that check the parent table, to see if the status is open. If not, the constraint will only block if I update the file number, but if I don't, it won't block.