Hi,
Does anyone know of a simple means to retrive a auto_increment primary key field after the insert takes place (so a subsequent update can be performed)?
You would want to find the specific function that the backend database offers to return that value.
For instance on MS SQL Server:
Code:
Insert into tablename ......
Select @@IDENTITY
will return to you the value that you're after. The value returned is guaranteed to be correct for your connection, even if other people are simultaneously inserting.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.