From: Date: January 18 2005 2:14am Subject: Re: Rollback and INSERT_ID() or LAST_INSERT_ID() List-Archive: http://lists.mysql.com/mysql/178603 Message-Id: <11b1bd9905011717147ad2805e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Just let it increment. Keeping it incremented is MySQL's way ot insuring that the same id doesn't get used twice for different records. It's doing everything correctly. -Eric On Mon, 17 Jan 2005 19:06:45 -0500, Andre Matos wrote: > Hi List, > > I have a field in one of my tables that uses auto-increment from MySQL > 4.1.8-nt (Windows XP). > > My problem is to get the last insert ID when the insert fails and I use > rollback. The MySQL is still incrementing the field. How can I avoid this if > it is possible? I am trying to avoid to use the function MAX() to get the > last ID inserted. > > Thanks for any help. > > Andre > > -- > Andre Matos > amatos@stripped > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=eric.bergen@stripped > > -- Eric Bergen eric.bergen@stripped http://www.bleated.com