We know, in the SQL Server Enterprise Manager, in the "Design Table" state, when checking the check constraint of the table, you will see the check constraint has "Check existing data", "Forced to copy the copy", " Three check boxes for INSERT and UPDATE enforcement, then do we know if we don't know if the three options of a Check constraint is not in an enterprise manager environment? I have viewed the help description of the relevant system table, but inside the record of many fields is "reserved", "for internal use", etc., there is no description of the field. But I found that when changing the selected state of the three options, the status field value of the corresponding Check constraint record in sysObjects changes. In order to know if there is regular, I have done the following test and draw some conclusions, take it out to share . "Check existing data", "Copying Forced Constraints", "For INSERT and UPDATE Mandatory Constraints", the three properties of the corresponding 000, 0 is not selected, 1 is selected.
Create a test form to create a collate check constraint and a table-level Check constraint, first make it empty table. In the following, the left side of the equal sign is the selected state of the three attributes, and the right side is the STATUS field value of the constraint record in the sysobjects table: for the column-level constraint: 000 = 3330001 = 2050100 = 3330 (still not selected after storage, I don't know why) 101 = 3074110 = 2306111 = 2 finds an except 111, the remaining first position is 0 as 0.
For table-level constraints: 000 = 3328001 = 3072010 = 2304011 = 2048100 = 3328101 = 3072110 = 2304111 = 0 can be found to have the same problem with the collar constraint, at the same time, for the same binary value, the table-level constraint is less than the collateral .
However, it is worth noting that the above test is in the absence of data in the table, so it may cause the highest number of three binary numbers. The following test table has the result of data (inserted data in accordance with the CHECK constraints in the test table):
For column level constraints: 000 = 3330001 = 3074010 = 2306011 = 2050100 = 3330101 = 3074110 = 2306111 = 2
For table-level constraints: 000 = 3328001 = 3072010 = 2304011 = 2048100 = 3328101 = 3072110 = 2304111 = 0
It can be seen that the results are identical. Guess reason is "Creating Excluding Excluding Data" A moment only in Check Constraints, after saving, the system will cancel, so if the existing Check constraint is viewed, this option is meaningless, so it is not selected.
But in the Pubs library, some Check constraints of the system existing Check constraints are 6, I don't know what? However, it is consistent with the above results after modification.