Michael, I found this using Google...

UPDATE Table1
        SET (...)
        WHERE Column1='SomeValue'

IF @@ROWCOUNT=0

INSERT INTO Table1
        VALUES (...)

Might be better? Che

-----Original Message-----
From: Michael Dinowitz [mailto:[email protected]] 
Sent: Friday, January 28, 2011 10:58 AM
To: cf-talk
Subject: Re: Insert without checking existance


Yes.

if exists(statement)
   something
else
   something else

The question I have to look up is if the whole operation is one 'unit' or
does it have to have transaction control. Is there a 'gap' between the
exists() check and the actual sql operation?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:341632
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to