In my SQL Server databases I group my tables by schema to help organize their purpose.
When I create constraints for columns on these tables I’ve been including the Schema as part of the name. For example, if I have a tables such as Com.WebUser and Com.Company:
PK_Com_WebUser --Primary key constraint
FK_Com_WebUser_Com_Company --Foreign key to Com.Company table
UQ_Com_WebUser_CompanyID_Username --Unique constraint on CompanyID & Username
I figured in the case I ever had another table with the same name in a different schema putting the schema in the constraint name would make things clearer, but the names are a bit verbose.
Is there a best practice for naming these objects?
I think adding the schema name is a good practice for the reason you already mentioned (repeated table names across schemas), I wouldn’t worry about how verbose the constraint name is, because you rarely need to reference those constraints.