Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

PRIMARY KEY VS UNIQUE KEY* Expand / Collapse
Author
Message
Posted Tuesday, July 30, 2013 8:04 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 12:12 PM
Points: 15,517, Visits: 27,896
A pretty common use of unique keys is when you have an artificial primary key for a table, the single most common example is the identity field, but you still need to define the logical key (and any other alternate keys) in order to prevent duplicate storage within the table.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1479018
Posted Tuesday, July 30, 2013 12:51 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Sunday, July 20, 2014 11:20 PM
Points: 13,252, Visits: 10,133
Grant Fritchey (7/30/2013)
A pretty common use of unique keys is when you have an artificial primary key for a table, the single most common example is the identity field, but you still need to define the logical key (and any other alternate keys) in order to prevent duplicate storage within the table.


True dat. A common scenario is in data warehousing, where you have a clustered index on the surrogate key of a dimension, and a unique index on the business key of the dimension.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1479137
Posted Wednesday, July 31, 2013 9:48 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 8:15 AM
Points: 3,068, Visits: 4,639
Koen Verbeeck (7/30/2013)
Grant Fritchey (7/30/2013)
A pretty common use of unique keys is when you have an artificial primary key for a table, the single most common example is the identity field, but you still need to define the logical key (and any other alternate keys) in order to prevent duplicate storage within the table.


True dat. A common scenario is in data warehousing, where you have a clustered index on the surrogate key of a dimension, and a unique index on the business key of the dimension.


+1 excellent example.


_____________________________________
Pablo (Paul) Berzukov

Author of Understanding Database Administration available at Amazon and other bookstores.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Post #1479555
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse