i need some clarification

  • i have a table where i need to populate child table in parents table i have a column which is a surrogate key and this same column is PK in child table my question is can i use Surrogate key as PK in child table??

  • aslamshaik6 (5/9/2013)


    i have a table where i need to populate child table in parents table i have a column which is a surrogate key and this same column is PK in child table my question is can i use Surrogate key as PK in child table??

    Do you mean if it's ok to use the same Surrogate Key as PK in "parent" and it's "child" tables? If so, that it's legitimate and fine. If you have 1-to-1 relationship than this surrogate key will be PK in a child table by itself, if you have 1-to-many,than your child table key will be composite and contain surrogate key from parent table.

    By the way, the main reason for surrogate key to exist is to provide non-application data identifier eg. PK.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply