How to update a record ONLY when data changes?

Results 1 to 2 of 2

Thread: How to update a record ONLY when data changes?

  1. #1
    Join Date
    Dec 1969

    Default How to update a record ONLY when data changes?

    I&#039;ve created a few online applications that allow users to update data (i.e. billing information) simply by submitting a form. Updates occur every time regardless if they have changed any of the data. To me this seems very inefficient and inaccurate when keeping track of updated user information.<BR><BR>I was wondering how some of you have gotten around this problem? Do you simply compare the new data to the original before submitting any changes? Use stored procedures to perform this task? Any feedback would be useful, thanks.

  2. #2
    Join Date
    Dec 1969

    Default Look in ASPFAQs...<BR><BR>Yeah, I know, the title doesn&#039;t seem relevant to your question. But read it all and you&#039;ll see that it is.<BR><BR>The answer is simple: Put the original value in a hidden field and then compare the hidden original value with the *possibly* modified value from the user. If they are the same, no update needed. ADVANTAGE: You don&#039;t have to make *any* query on the DB if there are no changes by the user.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts