[thelist] SQL Update CORRECTION

Ken Moore psm2713 at hotmail.com
Sun Jul 4 08:55:49 CDT 2004


Hi all,

I should have started with YES, of course, instead of no. Sorry abut the 
confusion.

>Hi all,
>
>
>Jason Robbins
>
>
>>Hey
>>
>>[On an] SQL DB,  I have been wondering though in the interests of good 
>>coding and such should I only be updating the fields that have actually 
>>changed?
>
>No. For 2 reasons. First, it is not good coding practice. It is redundant. 
>("Hi, I am from the Department of Redundancy Department.")  Second,. for 
>the sake of internal documentation, only update the fields that have 
>changed.
>
>There is one exception, that is if you have two functions (for example, 
>"scatter_tablename" and "gather_tablename") where one line loads all fields 
>into variables and the other saves all variables into the table. Even then, 
>in your calling procs, only update the data that has changed.
>
>Actually, for your purposes, this last idea may be a very good solution 
>since you seem to have many fields to update. In a single call, you may 
>save yourself many lines of code – and many typos – in loading and saving 
>data. And in many cases, it might be faster because everything is done in 
>one operation.
>
>Ken

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



More information about the thelist mailing list