how to create primary foreign key relationship on multiple tables

Posted by Parthibansk under Sql Server on 8/7/2012 | Points: 10 | Views : 1410 | Status : [Member] | Replies : 2
want to enforce Foreign Key referring multiple Primary key(s) from various tables ? (More than one table)




Responses

Posted by: Ranjeet_8 on: 8/7/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
PRIMARY KEY TABLE:
CREATE TABLE TEST(TESTID INT CONSTRAINT PK_TESTID PRIMARY KEY(TESTID),TESTNAME VARCHAR(50))

FOREIGN KEY RELATIONSHIP:
CREATE TABLE TESTRESULT(TESTID INT REFERENCES TEST(TESTID),MARKS INT,TESTPERCENTATE INT)



Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pandians on: 8/7/2012 [Member] [MVP] Silver | Points: 25

Up
0
Down
Question is not much clear!

Do want to enforce Foreign Key referring multiple Primary key(s) from various tables ? (More than one table)


Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response