Page 1 of 1

what is use of surrogate key?when we u r using this?

Posted: Fri Apr 23, 2010 11:59 pm
by harikumar
hi

Posted: Mon Jun 18, 2012 4:44 am
by Karthik.M
Surrogate key generator stage is used to generate a unique random number for each record in each run in a separate column.
This stage is useful when records are loaded everyday dynamically and each record needs to be identified uniquely.

Posted: Mon Jun 18, 2012 5:27 am
by ray.wurlod
The second person personal pronoun in English is spelled "you".

The present tense plural of the verb "to be" is spelled "are".

We strive for a professional standard of written English on DSXchange, not least to make life a little easier for those whose first language is not English.

Karthik.M wrote:a unique random number
This is not correct. The Surrogate Key Generator (or its equivalent function) generates a sequence of uint64 values, possibly in blocks. They are not random at the point of generation, which uses either a state file or a database sequence.

Posted: Mon Jun 18, 2012 6:13 am
by chandra.shekhar@tcs.com
A surrogate key is a unique primary key that is not derived from the data that it represents, therefore changes to the data will not change the primary key. In a star schema database, surrogate keys are used to join a fact table to a dimension table.

Posted: Mon Jun 18, 2012 6:33 am
by chulett
chandra.shekhar@tcs.com wrote:A surrogate key is a unique primary key that is not derived from the data that it represents, therefore changes to the data will not change the primary key. In a star schema database, surrogate keys are used to join a fact table to a dimension table.
Straight out of the documentation for the stage. :wink:

Re: what is use of surrogate key?when we u r using this?

Posted: Mon Jun 18, 2012 6:39 am
by chulett
harikumar wrote:hi
Harikumar, you really should put together better posts than this. Rather than "hi" you might have simply put "Surrogate key" as your subject and then a more fleshed out version of your questions in the post itself. Something more like:

What is the use of a surrogate key? When does one use this?

Of course, the simplest answer is to have you search for that information online as it has nothing directly to do with DataStage. Of course, you'll have to wade through the 7.4 million results that query returns, including this Wiki entry which is a good starting point.