Friday, February 24, 2012

How to get identity from parent Table and insert it into the child

Is this a one time process?
Are you going to do this in SINGLE_USER mode?
AMB
"RayAll" wrote:

> I have a table with the following schema
> F_NAME L_NAME COURSE_ID COURSE_DESC
> this table contains 10 records ,and I need to insert these records into 2
> tables .TBSTUDENT and TBCOURSE.
> in TBSTUDENT ,I have student_id which is an identity column and in TBCOURS
E
> ,I have a foriegn key to this field. How can I isert 10 records from the
> first table into TBSTUDENT AND TBCOURSE ,where I should first get the
> identity generated from the first insert and use it in the second
> insert(into TBCOURSE).
> Thanks
>
>This is a process called by a DTS package and once at a time.
Thanks for your reply.
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:628A3F8D-9DF9-4EED-B061-3C22A3A266DF@.microsoft.com...
> Is this a one time process?
> Are you going to do this in SINGLE_USER mode?
>
> AMB
>
> "RayAll" wrote:
>

No comments:

Post a Comment