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:
01547400
Views:
23
>>>>>>>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)
>>
>>----------------
>
>I didn't know he wrote a book. Thank you.

He wrote several. I have 4 out of 5 books series SQL Programming Jos Pros 2. He had a 35 days SQL quiz and randomly selected 1 person from USA and one from all other world as a winner.

http://blog.sqlauthority.com/2011/08/01/sql-server-win-a-book-a-day-contest-rules-day-0-of-35/

You may want to read each day - very simple and good stuff.
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