Is there some standard way to name indexes for SQL Server? It seems that the primary key index is named PK_ and non-clustered indexes typically start with IX_. Are there any naming conventions beyond that for unique indexes?
+4
A:
I usually name indexes by the name of the table and the columns they contain:
ix_tablename_col1_col2
Mark Byers
2010-05-06 18:37:39
How do you differentiate between index columns and included columns?
John Sansom
2010-05-07 07:37:57
I'm pretty sure that he's only listing the Indexed columns, in the order that they're being placed in the index.
Brett
2010-06-23 18:17:15
+2
A:
I use
PK_ for primary keys
UK_ for unique keys
IX_ for non clustered non unique indexes
UX_ for unique indexes
All of my index name take the form of
<index or key type>_<table name>_<column 1>_<column 2>_<column n>
JSR
2010-05-06 18:44:26
A:
I know a old topic but thought I'd throw in my 2cents worth
- PKC_ Primary Key, Clustered
- PKNC_ Primary Key, Non Clusterd
- NCAK_ Non Clustered, Unique
- CAK_ Clustered, Unique
- NC_ Non Clustered
Example;
NCAK_AccountHeader_OrganisationID_NextDate
Where NCAK : Non Clustered, Unique, AccountHeader : Table and OrganisationID_NextDate : Columns.
FairFunk
2010-10-29 10:57:28