|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Primary Key Foreign Key TablesHi All,
i do have two table a Master and a Detail which has a primary key on the Master Table and Foreign key on the Detail Table How do i insist that when ever there is a entry in the Master table there should atleast exist one record in the Detail Table. Any sort of condition can be made Thanks in advance thomson Circular references are complex in SQL. An easier way is to write a trigger
to check the existance of rows in the referencing table. -- Anith This is typically handled best in a client application (e.g., an n-tier
object) as a business rule. see the following link for some more thoughts on this: http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci976558,00.html thomson wrote: Show quote >Hi All, > i do have two table a Master and a Detail which has a primary >key on the Master Table and Foreign key on the Detail Table > > >How do i insist that when ever there is a entry in the Master table >there should atleast exist one record in the Detail Table. Any sort of >condition can be made > > >Thanks in advance > >thomson > > > |
|||||||||||||||||||||||