Best Practice: Flagging Changed Rows

Discussion in 'ASP General' started by Mario T. Lanza, Feb 16, 2004.

  1. I am developing an ASP class that allows users to view/edit many
    records in a table directly via their browser. In order to reduce the
    number of SQL statements being executed against the database I am
    storing hidden input fields that I am using to determine whether or
    not changes have occurred against a given row.

    I've been able to do this in two possible ways.

    1) I've stored the original values of the displayed fields in hidden
    variables and use them for comparison purposed to determine if changes
    have occurred.

    2) I've stored one hidden input named "Modified" per row. Then on
    each field I flag the corresponding Modified field via client-side
    script whenever a field is changed.

    The first method is more accurate but, I believe, has much more
    associated overhead. It's more accurate that the second method in
    only uncommon situations, such as the one described:

    The user changes the value of a given field on a particular record
    then, thinking better of the change, he reverts to the original value.
    Using the first method, no update would be detected on the row.
    Using the second method, an update would be detected though none has
    been made.

    If anyone considers one method better than the other please offer your
    reasoning.

    Mario T. Lanza
    Clarity Information Architecture, Inc.
    Mario T. Lanza, Feb 16, 2004
    #1
    1. Advertising

  2. Mario T. Lanza

    middletree Guest

    You can make an entirely new table called an Audit table. Search the SQL
    Server Programming forum for details.


    "Mario T. Lanza" <> wrote in message
    news:...
    > I am developing an ASP class that allows users to view/edit many
    > records in a table directly via their browser. In order to reduce the
    > number of SQL statements being executed against the database I am
    > storing hidden input fields that I am using to determine whether or
    > not changes have occurred against a given row.
    >
    > I've been able to do this in two possible ways.
    >
    > 1) I've stored the original values of the displayed fields in hidden
    > variables and use them for comparison purposed to determine if changes
    > have occurred.
    >
    > 2) I've stored one hidden input named "Modified" per row. Then on
    > each field I flag the corresponding Modified field via client-side
    > script whenever a field is changed.
    >
    > The first method is more accurate but, I believe, has much more
    > associated overhead. It's more accurate that the second method in
    > only uncommon situations, such as the one described:
    >
    > The user changes the value of a given field on a particular record
    > then, thinking better of the change, he reverts to the original value.
    > Using the first method, no update would be detected on the row.
    > Using the second method, an update would be detected though none has
    > been made.
    >
    > If anyone considers one method better than the other please offer your
    > reasoning.
    >
    > Mario T. Lanza
    > Clarity Information Architecture, Inc.
    middletree, Feb 16, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    671
    Rosanne
    Oct 11, 2005
  2. Mr. Magoo
    Replies:
    0
    Views:
    359
    Mr. Magoo
    Sep 1, 2003
  3. Mumia W.

    [VOTE] Multi-post flagging 'bot

    Mumia W., Aug 14, 2006, in forum: Perl Misc
    Replies:
    0
    Views:
    81
    Mumia W.
    Aug 14, 2006
  4. Mumia W.
    Replies:
    12
    Views:
    188
    John Bokma
    Aug 15, 2006
  5. oldyork90
    Replies:
    1
    Views:
    147
    Jeremy J Starcher
    Sep 10, 2008
Loading...

Share This Page