Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Surrogate keys

Author  Topic 

carumuga
Posting Yak Master

174 Posts

Posted - 2009-01-12 : 09:03:05
Hi,

What is the need of surrogate key though my table has primary key defined and the value doesnt change. Is there any advantage in having surrogate in the table?

Thanks in advance.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-01-12 : 09:40:12
Read this:
http://decipherinfosys.wordpress.com/2007/02/01/surrogate-keys-vs-natural-keys-for-primary-key/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-12 : 10:13:36
yup. you have quite a few. one case is where your data comes from more than one source. such cases there can be possibilities of same value as pk on both systems. thus use of surrogate key ensures uniqueness. Also it provides a standardization just in case pks are different format in both systems.Also there can be cases where you want to represent special conditions (stages ) in data which you cant represent by means of pk like value not assigned, period yet to come,... which is significant in analytical systems.Another case is when you want to track changes of your data over time by adding new rows with same pk but just surrogate key changing over time.
Go to Top of Page

carumuga
Posting Yak Master

174 Posts

Posted - 2009-01-13 : 07:27:34
Pretty impressive. Thanks for you input
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-13 : 08:49:36
welcome
Go to Top of Page
   

- Advertisement -