In SQL Server you can use the OBJECTPROPERTY()
function to find out whether or not an object is a CHECK
constraint.
This function accepts two parameters: the object ID, and the property for which you’re checking it for.
Therefore, you can pass the object ID as the first argument, and IsCheckCnst
as the second, and the function will return either a 1
or a 0
depending on whether or not it’s a CHECK
constraint.
A return value of 1
means that it is a CHECK
constraint, and a value of 0
means that it’s not.