Re: SQL Update question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



That's one reason for a Dirty property, but mostly it's so you know
whether to prompt the user to save data that hasn't been saved yet when
they close the form. To "dump the change and go back" requires that you
store the original value somehow.

Actually, on an Access form, you can simply undo the control's/form's update
(ControlName.Undo or Form.Undo, IIRC) and it'll revert to the old value(s)
providing it's bound (which is pretty much the norm for Access)...I don't
*think* it works for unbound controls/forms.

Generally, if ONE thing needs updated, you just update everything, even if
the values are the same. It's just easier this way because you've only got
one UPDATE SQL statement.

This only applies if you're using UPDATE statements. If you're using a
rs!Field.Value = MyValue, then the one-update thing isn't really an issue,
as DAO or ADO will figure out what's appropriate. In this case, it would
probably be more desirable to not update if the field hasn't changed.

Two reasons NOT to update everything are 1) if there's some kind of
replication going on (particularly column-level replication) in the
database, in which case updating a field, even if it's to the same value,
may trigger unnecessary replication of the data and potentially cause
conflicts; and 2) if you're using a database that supports triggers,
updating a field unnecessarily may cause the trigger to fire. This may be
undesirable if, say, you're tracking the time a specific field last changed
and the field hasn't actually changed.



Rob


.



Relevant Pages

  • Re: Which replication will fit in this structure
    ... goes off line the subscriber will be read only. ... If you use queued updating ... Merge replication uses triggers to track changes which will mean all dml on ... peer to peer replication. ...
    (microsoft.public.sqlserver.replication)
  • Security aspects of GT.M triggers
    ... primary host is able to create and execute an arbitrary code on all ... Since the replication itself does not have any strong security ... limit or disable the trigger functionality. ... filter out the trigger updates from the replication stream, ...
    (comp.lang.mumps)
  • Re: Triggers and Merge replication
    ... Merge replication does not allow ping-pong movement of data by design. ... If you insert data into publisher, then your trigger fires and inserts ... > I have a database that is replicated between 3 SQL servers ...
    (microsoft.public.sqlserver.replication)
  • Re: Replication conflict
    ... I think the trigger should look like this ... FOR INSERT, UPDATE NOT FOR REPLICATION ... is removing the domain name, whereas this will perform better for you. ... between sync's you will have a conflict. ...
    (microsoft.public.sqlserver.replication)
  • Re: Complicated Merge Replication/Trigger problem
    ... tracking Im going to cause a conflict as far as I understand it? ... After making the changes on the publisher ... and 1 upload is showing in replication monitor. ... Curiously when I disabled the trigger and made the ...
    (microsoft.public.sqlserver.replication)