in reply to Re: Issue with simultaneous MySQL actions
in thread Issue with simultaneous MySQL actions
you can quickly create this table like so:
and then, before running your insert, run a transactioned query to get and set the max id of an agentselect agent,max(id) into agent_id from tracker group by agent
this should ensure you have no ID collissionsbegin tran set nocount on update agent_id set ID = ID + 1 where Name = 'abc' select ID from agent_id where Name = 'abc' commit tran
HTH!
Update: I just read the auto-incremental part of your post... which pretty much squashes this reply. shame on me.
|
|---|