Joining the tables should be more efficient.  The general rule of thumb I go with is to let the database do as much of the heavy work as possible, it is better at it then I am.  


But even more important than a few nanoseconds saved here and there; is the time saved in creating code that is easier to debug, update and maintain.  Your first example code would have to be modified any time a new template is created.  But since the template is stored in the database there is no need to this.  Buy joining the queries, as soon as a new template is created and used, it automatically will be displayed without having to go into your code and creating a new branch in your cfswitch or cfif/cfelseif logic.

--------------
Ian Skinner
Web Programmer
BloodSource
<file:///C:\Documents%20and%20Settings\iskinner\Application%20Data\Microsoft\Signatures\www.BloodSource.org> www.BloodSource.org <http://www.BloodSource.orgSacramento>
Sacramento, CA

"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to