Depending on your table size, indexing and number of rows actually being
updated, it may be better to just wrap all the updates into a transaction.

BEGIN TRAN;

UPDATE......
UPDATE......
UPDATE......
....
COMMIT TRAN;

The case statement example may not be optimal, as it will update every row
unnecessarily. Not nice if you have a million row table and only need to
actually update 30 rows.

Multiple OR statements is probably better, as you will be restricting the
update to the required rows, but might be hard to read for debugging. Plus
too many ORs and performance may be more optimal with multiple updates.

I usually find the simple the better.

Byron Mann
Lead Engineer & Architect
HostMySite.com


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/sql/message.cfm/messageid:3538
Subscription: http://www.houseoffusion.com/groups/sql/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/sql/unsubscribe.cfm

Reply via email to