Link 2 primary key between them

Hi experts,

i just want to know if it is a good thing to do such a thing :

i have a primary key in table A and a primary key in table B

i linked primary key A to primary key B

because bot column have same value and have to be unique

thank you in advance.

regards
LVL 2
Dnx_7Asked:
Who is Participating?
 
derekkrommCommented:
It will work just fine. Its simply not the best design because its redundant (i.e. not normalized). But technically speaking, it will work fine.
0
 
derekkrommCommented:
If both columns are the same/unique, then you should probably combine table A/table B into 1 table. Stick all of the columns (minus the PK) from table B into table A (or vice versa).
0
 
Dnx_7Author Commented:
no i can't modify the structure of table A
because table B is a new table with a "higher" level to achieve new task
table A cannot be modify...

that's why we tried this solution, in management studio, we save the primary key of table A as a foreign key of primary key of table B
and there is no error... and we did some test with success... and we tought that it was the good idea

that's why i'm here to have suggestion of experts

regards
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
>i just want to know if it is a good thing to do such a thing :
this depends. for example if tableA is a master table something like an employee table and tableB is something like a sal table , then you can create a foreign key relationships
0
 
Dnx_7Author Commented:
ok, thank you guys :)

regards
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.