>
> Beware of doing it this way... You will need cftransaction or some other
> way of ensuring that the ID is unique. Consider the situation where 2
> inserts from 2 different people are happening nearly simultaneously. The
> second request for the max(ID) could occur before the first is
> inserted....



Is that definately true with the select insert as I exampled? I imagine (but
that is all I do, quite willing to be wrong) that the single SQL statement
must complete before another is allowed to run..? I.e. I imagine that this
SQL will not run into the problem you describe:

INSERT INTO myTable (id, title)
SELECT Max(id) + 1, 'Some title'
FROM myTable

Cheers,

Dominic


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295204
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to