To disable a CHECK constraint, use the NOCHECK argument within an ALTER TABLE statement. Here’s how to do that using Transact-SQL. If you find yourself in this situation, you can always disable the constraint. Either way, you won’t be able to enter anything outside the rules of the constraint. If you attempt to enter invalid data, the operation will fail with an error.īut what if you find yourself in the situation where you really must insert data that will violate the CHECK constraint? Perhaps the constraint no longer applies, or maybe you have an exception where one row is allowed to bypass the constraint. When you attempt to enter data into a table that has a fully enabled CHECK constraint, you will only be successful if the data doesn’t violate that constraint.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |