Skip to Content
0

Can Anyone Tell me Difference Between Primary key and Surrogate Key with Example In Sap BODS ?

Apr 20 at 04:11 PM

55

avatar image

Regarding SAP BODS

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Arun Sasi Apr 23 at 09:42 AM
0

The primary key is a unique value that identifies each record. Sometimes the primary key is made up of real data and these are normally referred to as natural keys, while other times the key is generated when a new record is inserted into a table.

Definition: A surrogate key is an artificial or synthetic key that is used as a substitute for a natural key.

When a primary key is generated at run time, it is called a surrogate key.

E.g. In SCD Type II, when we preserve the history we store the new record(Active) in a new row for which we assign a Surrogate key.

A surrogate key is typically a numeric value. E.g in SQL Server we have an Identity property to help generate surrogate key values.

Regards

Arun Sasi

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Arun sir. Helpful Answer

0
Vibhor Gautam Apr 23 at 05:26 PM
0

are you new to bods ?

Share
10 |10000 characters needed characters left characters exceeded
Vibhor Gautam Apr 23 at 05:34 PM
0

primary key- A primary key column cannot have NULL values.

It is a field in a table which uniquely identifies each row/record in a database table. for eg- In a emp table, EMP ID is a primary key.

Surrogate Key- The most common type of surrogate key is an incrementing integer, such as an auto_increment column in a dynamic table.

Duplicates are not allowed in surrogate key. It is a artificial key that is user defined.


Share
10 |10000 characters needed characters left characters exceeded