473,320 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Best Practice: Flagging Changed Rows

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.
Jul 19 '05 #1
1 1232
You can make an entirely new table called an Audit table. Search the SQL
Server Programming forum for details.
"Mario T. Lanza" <ml****@lycos.com> wrote in message
news:bd*************************@posting.google.co m...
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.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
10
by: Rich Wallace | last post by:
Hey all, I have an XML doc that I read into a SQL Server database from an integration feed.... ----------------XML snippet ---------------- <?xml version="1.0" encoding="us-ascii"?>...
9
by: Alfred Taylor | last post by:
I'm testing the waters of n-tier development and I ran into a scenario that I'm not sure what the best solution would be. I have a Company object which contains a collection of contacts retrieved...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
0
by: newtonwong | last post by:
Hi, I'm wondering whats the best practice to accomplish the following display in a DataGridView. 1. Perform a Query to an Oracle DB with a multiple join select that returns multiple rows....
3
by: Rich | last post by:
The procedure below checks if a character entered into a cell of a datagridview is contained in a string array of valid characters for this particular cell. It seems kludgy. I am asking what the...
7
by: Steve | last post by:
I am building an object library for tables in a database. What is the best practice for creating objects like this? For example, say I have the following tables in my database: User: - Id -...
56
by: Zytan | last post by:
Obviously you can't just use a simple for loop, since you may skip over elements. You could modify the loop counter each time an element is deleted. But, the loop ending condition must be...
1
by: Clausen | last post by:
Hi, Looking for best practice - or just some "what would you do" answers :) Scenario: App1.dll and App2.dll are both referenceing Logging.dll. And both are applications installed at...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.