Skip to Content
avatar image
Former Member

how-to-create-a-foreign-key-relation-with-a-non-key-field??

How-to-create-a-foreign-key-relation-with-a-non-key-field.?

I have a field emp_name in a table called X where it is a non-key field.

I want to make it a foreign-filed in another table called Y.

Is it possible?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 11, 2017 at 04:00 AM

    As far as I know, it's not possible because foreign key relationship is used to maintain referential integrity constraints of the database and this constraints restricts the values in dependent table from the key vaules in the parent table.

    In short, not possible. What's the requirement?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 19, 2017 at 09:07 AM

    Hi Ankit,

    I wanted to assign a non-key field of one table to as a suggestion field in another table.

    Thanks for the reply I checked with other seniors too they suggested me it is not a recommended and feasible design.

    Thanks again.

    Add comment
    10|10000 characters needed characters exceeded