Please help

Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2008
Posts: 268
Reputation: Traicey is an unknown quantity at this point 
Solved Threads: 19
Traicey's Avatar
Traicey Traicey is offline Offline
Posting Whiz in Training

Please help

 
0
  #1
Dec 1st, 2008
I have 2 related tables, master and a child, the master table have a primary which is an autonumber and I reference that autonumber to my child table as a foreign key so my problem is to get the value of the autonumber from a master table and write it to my child table when adding a new record to my child table, I was wandering if anyone know how to do that

Thanx in advance
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,162
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Please help

 
0
  #2
Dec 1st, 2008
it depends what you are doing at time of insert to the master table, if you are using a stored procedure you can use this

  1. INSERT INTO mastertable .....
  2.  
  3. SELECT @@identity

same as your other post, i would say to close the other one
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the MS SQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC