Re: Which syntax would be better for performance?

From: Joe Celko (jcelko212_at_earthlink.net)
Date: 07/15/04


Date: Thu, 15 Jul 2004 13:25:50 -0700

I would go with "mycolumn = COALESCE(@myparm, mycolumn)" since it is
easier to read and writem and the COALESCE() can be extended to several
values:

mycolumn = COALESCE(@myparm_1, @myparm_2, @myparm_3, mycolumn)"

This lets you write a lot of logical controls in a function notation and
avoid IF-THEN-ELSE control flow or CASE expressions.

--CELKO--
 ===========================
 Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!