I have done some searching but haven't found a solution to my problem.
I started with some databases where users didn't care to name PK constraints, foreign keys or indexes, ending up with system generated names like PK__CarRenta__3213E83F2E5BD364
. On mssqltips there's a great article by Aaron Bertrand about how to rename these objects using a stored procedure.
So that's great...but how do I avoid users or applications creating new objects without names which are then assigned a system generated name by SQL Server?
I have already read an article by the same great Aaron Bertrand on how to use policy based management to enforce naming conventions. However it seems that this is only good for notification after the horse has already bolted (or the object has been created).
Can you think of a way to automatically roll back statements that try to create an object without a name?