Log in  ::  Register  ::  Not logged in

 Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Implementing Surrogate Key Rate Topic Display Mode Topic Options
Author
 Message
 Posted Thursday, August 02, 2012 3:49 AM
 SSC Veteran Group: General Forum Members Last Login: Thursday, December 05, 2013 12:04 AM Points: 204, Visits: 473
 How to implement surrogate key ?
Post #1339037
 Posted Thursday, August 02, 2012 6:35 AM
 SSCertifiable Group: General Forum Members Last Login: Friday, December 06, 2013 7:32 AM Points: 6,274, Visits: 12,089
 shahsn11 (8/2/2012)How to implement surrogate key ?CREATE TABLE MyTable (MyTableID INT IDENTITY(1,1) PRIMARY KEY,... “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail ShawFor fast, accurate and documented assistance in answering your questions, please read this article.Understanding and using APPLY, (I) and (II) Paul White Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff ModenExploring Recursive CTEs by Example Dwain Camps
Post #1339095
 Posted Thursday, August 02, 2012 7:08 AM
 SSC Veteran Group: General Forum Members Last Login: Thursday, December 05, 2013 12:04 AM Points: 204, Visits: 473
 So does that mean that Surrogate Key is only the concept. And in lay man terms(i.e. mine) can we say that PK=Surrogate Key.If the above is true that what is the difference between Pk and surrogate key.
Post #1339128
 Posted Thursday, August 02, 2012 7:18 AM
 SSChampion Group: General Forum Members Last Login: Today @ 1:26 PM Points: 11,200, Visits: 8,047
 shahsn11 (8/2/2012)So does that mean that Surrogate Key is only the concept. And in lay man terms(i.e. mine) can we say that PK=Surrogate Key.If the above is true that what is the difference between Pk and surrogate key.A surrogate key is by defination meaningless, aka a simple integer with no meaning attached which serves as a primary key. A primary key is a combination of one or more columns that uniquely identify a row. So it's possible this is for example a customerID, such as AW001578. This has meaning, as it is customer number 1578 of the Adventure Works company. Or it can be an emailaddress to uniquely identify a person. This is often called the "natural key".So, a surrogate key is a primary key, but a primary key is not necessarily a surrogate key. 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 #1339139
 Posted Thursday, August 02, 2012 7:25 AM
 SSCertifiable Group: General Forum Members Last Login: Friday, December 06, 2013 7:32 AM Points: 6,274, Visits: 12,089
 shahsn11 (8/2/2012)So does that mean that Surrogate Key is only the concept. And in lay man terms(i.e. mine) can we say that PK=Surrogate Key.If the above is true that what is the difference between Pk and surrogate key.A PK is a means of uniquely identifying a row. It's either an attribute(s) of the data (natural key), or it can be generated by the RDBMS (surrogate key). Here's a nice article to get you started. “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail ShawFor fast, accurate and documented assistance in answering your questions, please read this article.Understanding and using APPLY, (I) and (II) Paul White Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff ModenExploring Recursive CTEs by Example Dwain Camps
Post #1339149

 Permissions