dhruvslg86
06-14-2009, 04:29 PM
hii every one,
lets straight away ask my question..
i have three tables
table1
-----------------
id1 primary key <indentity column>
tb1
-----------------
table2
-----------------
id2 primary key <indentity column>
tb2
-----------------
table3
-----------------
id primary key <identity column>
id3 foreign key (referencing table1-->id1,table2-->id2)
-----------------
**table3 has two referential constraint for table1 and table2
now suppose i insert a tuple (say 'iop' in table1 and 'rey' in table2)
and then i want to insert the same tuples in table3......
THEN THE PROBLEM ARISES
when i insert 'iop' then the table2's referential constarint is violated and conflicts
and again
when i insert 'rey' then the table1's referential constarint is violated and conflicts
How do i basically implement a Many-to-one relationship in Microsoft Sql server 2005?
lets straight away ask my question..
i have three tables
table1
-----------------
id1 primary key <indentity column>
tb1
-----------------
table2
-----------------
id2 primary key <indentity column>
tb2
-----------------
table3
-----------------
id primary key <identity column>
id3 foreign key (referencing table1-->id1,table2-->id2)
-----------------
**table3 has two referential constraint for table1 and table2
now suppose i insert a tuple (say 'iop' in table1 and 'rey' in table2)
and then i want to insert the same tuples in table3......
THEN THE PROBLEM ARISES
when i insert 'iop' then the table2's referential constarint is violated and conflicts
and again
when i insert 'rey' then the table1's referential constarint is violated and conflicts
How do i basically implement a Many-to-one relationship in Microsoft Sql server 2005?