Andile Choko

Andile Choko

  • NA
  • 53
  • 53.2k

How to save a foreign key to another table

Jun 27 2011 5:55 AM
Dear programmers;




I have the follwing:


  Create table CHILD
(
 UNIQUEIDENTIFIER CID PRIMARY KEY,
 fNAME VARCHAR(25),
LNAME VARCHAR(50),

)

Create table Parent
(
 UNIQUEIDENTIFIER PARID PRIMARY KEY,
 fNAME VARCHAR(25),
LNAME VARCHAR(50),
   UNIQUEIDENTIFIER  CID FOREIGN KEY REFERENCES(cHILD) CID

)

i have details of a parent and that of the parent's child.
 need to save the PK of the child table into the parent table.
the input( details) come from a windows form application
How do i achieve this USING STORED PROCEDURES ?

Answers (2)