> Why, what's the matter with using the MAX() function?  Is it anything
> other than the performance load?

Using stored procedures or triggers not only performs better, but is less
likely to fail on you. If you wrap an insert query and a SELECT MAX() query
in CFTRANSACTION, you're not guaranteed that you'll get the right identity
column value, depending on how locks are handled by your database. For
instance, if your database supports row-level locking, your insert query
will lock the newly-created row, but someone else could insert another row,
and you could still end up retrieving the second row's identity column
value, without violating your CFTRANSACTION logic.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to