Naming CHECK and UNIQUE Constraints
I’m not a fan of letting the system automatically name constraints, so that always leads me to thinking about what names I really want to use. System-generated names aren’t very helpful.
Primary keys are easy. There is a pretty much unwritten rule that SQL Server people mostly name them after the table name. For example, if we say:
![]()
A violation of the constraint will return a message like:
![]()
2014-11-12