LAST_INSERT_ID()
SET @X = LAST_INSERT_ID()
The ID that was generated is maintained in the server on a per-connection basis. This means that the value returned by the function to a given client is the first AUTO_INCREMENT value generated for most recent statement affecting an AUTO_INCREMENT column by that client.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)