Fulfillment of the following query leads to all restrictions in our client database. However, a few rows in the result set, do not seem to have a parent that is parent_object_id = 0and OBJECT_NAME(parent_object_id)returns NULL.
SELECT name, type_desc, OBJECT_NAME(parent_object_id), parent_object_id
FROM sys.objects
WHERE is_ms_shipped = 0
AND type_desc LIKE '%_CONSTRAINT'
Does this mean that there are orphan restrictions in the database? If so, how can I remove them?
From their names, I see that they are leftovers before most of the changes were made to the structure.
source
share