SQL Server index and constraint naming convention

enter image description here

SQL Server index naming convention

  • If Index is Primary Clustered Index: PKTableNamePrimaryColumnName
  • If Index is Non-clustered Index: IXTableNameColumnName1_ColumnName2…
  • If Index is Unique Non-clustered Index: UXTableNameColumnName1_ColumnName2…

Constraint naming convention

  • FKTableNameForeignKeyColumnName for foreign key constraint
  • CKTableNameDescriptiveNameForThisConstraint check constraint UQTableNameColumnName - unique constraint, prefer to use unique index because of more options but if your intention is only for preventing duplicated data and not search, go for unique constraint.
  • DFTableNameColumnName default constraint

Credit https://blog.sqlauthority.com/2012/05/21/sql-server-renaming-index-index-naming-conventions/

Facebook Page