View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 06:23 AM
Dotan Cohen
 
Posts: n/a
Default Re: only update if values different

On 09/12/06, Nick Meyer <n.meyer@usa.net> wrote:
> What is the best way to UPDATE a row only if values are different? We
> have a mainframe extract that literally has 100,000 rows and am worried
> about the performance of just running INSERTs each night.
>
> Is there a simple comparison command or would you have to nest a SELECT
> statement? Thank you,
>
> Nick
>


You have to check the line first, then compare and update if
neseccary. I've been through that recently, and decided that it was
better to just UPDATE. Of course, I had much less rows than you do.

Maybe you could store an array of changed rows in whatever language
you are programming, then update from that? Or a text file, another
DB, whatever...

Dotan Cohen

http://what-is-what.com/what_is/digg.html
http://dramatherapy.info
Reply With Quote