How to make a parent and child table?
Loading
How to make a parent and child table?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vijaya KadiyalaPosted Jun 24, 2008, 3:54 PM
Hi
Basically you need to define PRIMARY KEY and FOREIGN KEY relationship to make two tables in PARENT-CHILD relationship.
Thanks -- Vj
http://dotnetvj.blogspot.com
Dipal ChoksiPosted May 13, 2008, 11:43 PM
Create 2 tables with the primary key of the parent table set as foreign key of the child table (assuming 1-M parent-child relation)
eg.
Parent table:
ParentID INT IDENTITY(1, 1)
ParentField1 varchar(50)
ParentField2 int
etc
Child Table:
ChildID INT IDENTITY(1, 1)
ParentID int
ChildField1 int
ChildField2 varchar(15)
etc