Motivation - I want to fail our Gated Check-In whenever an unnamed constraint is added.
I could not find any dedicated designation for unnamed constraints in Sql Server. So, it is down to the pattern matching, which I can do in C#.
But what is the pattern? The simplest one that covers most of the cases is to check for "__", but it is not 100% reliable.
So, how would you check that a constraint is explicitly named given its name and having full access to the sys tables?
An alternative and even better solution would be if there is a way to disable unnamed constraints in the first place, but only for the current session.