Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique index name?
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01547384
Message ID:
01547395
Views:
22
>>>>>Hi,
>>>>>
>>>>>Do you think it makes sense or matters to name unique index differently from any other index? For example, IX_tablename_columnname vs UX_tablename_columnname?
>>>>
>>>>It's a matter of preference. Doesn't make any difference for SQL Server.
>>>
>>>I understand that for SQL Server it does not matter. I probably should have asked what conventions people prefer. I read an on-line article by Pinal Dave (he writes a blog on SQL Server) where he makes many suggestions as to the naming conventions but never mentions the unique index key. So that brought up the question.
>>>Thank you.
>>
>>You can create unique index by creating unique constraint (index will be created automatically). So, you can follow his naming conventions for unique constraint.
>
>I don't see anywhere in his blog post where he talks about unique constraint. This is the page I am looking at:
>
>http://blog.sqlauthority.com/2008/09/23/sql-server-coding-standards-guidelines-part-1/

I have his book. The name convention he uses is:

UQ_TableName_ColumnName

-----------------------------
Alter table HumanResources.RoomChart ADD CONSTRAINT UQ_RoomChart_RoomNotes UNIQUE (RoomNotes)

----------------
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform