Member_2_7967119
asked on
Help with the SQL Script.
I have a table A with two columns as Primary Key. Is it firstly possible.
Secondly, if the first column of table A(say C1) is set as PK1 and Foreign Key to another primary key column of table B.
Similarly, second column of table A (say C2) is set as PK2 and Foreign Key to another column of table C.
I wish to have a table created and the data to be added to C1 of Table A should allow repeatation( ie duplicate entries should be permissible.
In my limited understanding, can the C1 be a combination of PK1 and FK?
I am using SQL Server 2008
Please advise
Secondly, if the first column of table A(say C1) is set as PK1 and Foreign Key to another primary key column of table B.
Similarly, second column of table A (say C2) is set as PK2 and Foreign Key to another column of table C.
I wish to have a table created and the data to be added to C1 of Table A should allow repeatation( ie duplicate entries should be permissible.
In my limited understanding, can the C1 be a combination of PK1 and FK?
I am using SQL Server 2008
Please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nitin Sontakke,
Can you provide me the table script to build the composite key.
Thanks.
Can you provide me the table script to build the composite key.
Thanks.
ASKER
Do not worry, I got it. Thank you for your inputs.
ASKER
Thank you for your valuable inputs.
The above is possible ONLY IF you have a compound keys. However, then again, only one combination C1 + C2 would be allowed. So you can A + A, A + B, A + C, A + D and so on but no other A + A is allowed, of course!