Which database? Serial is a sqlserver thing isn't it? You can't reliably
do this sort of thing on sql server 2003 (I think that's the right
version). My solution was convoluted and annoying, involving a dummy
table to simulate a sequence (like a sequence from postgres) and making
sure to keep the transaction atomic.
Kevin Jenkins wrote:
If I use the SQL command INSERT to insert a row into a table which has a primary key with the serial property, to automatically generate a per-row unique ID, how do I get the ID of the thing I just inserted? Should I immediately query for the newest ID?
--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html
-- Jacob Briggs Systems Engineer
Core Technology Limited Level 1, NZX Centre 11 Cable Street Wellington Phone +64 4 801 2252
--
object doAnythingConceivable(string whatToDo, object whatToDoItWith) { .....
--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html