View Single Post
 
Old October 2nd, 2006, 11:22 AM
dparsons dparsons is offline
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

A stored procedure would be best in this secnario (as you could handle all data with one call), IMHO, but since you aren't you will have to make 2 calls to the database before you can work with the second table:

//INSERT Statement

Then assign this value to a variable and you can work with the second table.
SELECT max(primary_key) from table1

I agree that this is a bit clumsy but since you don't intend to use SP's I dont really see any alternative.





--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.