Skip to Content

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

Regarding SAP BODS

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Apr 23 at 09:42 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 23 at 05:26 PM

    are you new to bods ?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 23 at 05:34 PM

    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.


    Add comment
    10|10000 characters needed characters exceeded