There are a number of ways to solve this issue. The solution Michael Grant recommended is a good one and is probably the most common approach. The test for existence should be slightly faster than getting the exact row count, although the speed difference is likely unnoticeable.
Assumption: there is a near zero risk of two inserts happening at the same time. If this assumption is false, then the recommended solution changes because it is not thread-safe. -Mike Chabot On Thu, Jan 27, 2011 at 6:29 PM, Michael Grant <mgr...@modus.bz> wrote: > > > > > Is exists() more efficient than this? > > > > That I don't know. I suspect it is, and that it's pretty nominal. > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341586 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm