dbTalk Databases Forums  

how to insert one Parent and Multiple child records into SQL Serve

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss how to insert one Parent and Multiple child records into SQL Serve in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Ilya Albrekht
 
Posts: n/a

Default Re: how to insert one Parent and Multiple child records into SQL Serve - 06-25-2008 , 09:45 PM






You may use Select @IDENITY to get last generated auto increment field. And
use it as much time as you need to create OrdersItems

"Hezal" <Hezal (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,
I have created 2 tables, Orders and Order Items. Using C# I am able to
add
a single order and use that order's ID as an input for OrdersItems table
to
insert one record within a Transaction.
But I need to have multiple order items for one order.

Please help, as I urgently need to solve my problem...
Thanks.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.