Quote:> Assuming I have to update at least one column, how much of a performance
> problem is it to update all of the columns even if they didn't change?
> I have stored procedures doing my updates, which means I can either pass
in
> and update every column value whether it changed or not, or just pass the
> values that changed and then do a separate UPDATE statement for each
> parameter that isn't NULL -- all updating the same row, all wrapped in a
> transaction.
> Is there a philosophy on this? Thanks.
Depending on various rules the update can be done in-place or deferred.
In-place updates (or direct updates) are much faster since
only row modification of the page are logged in the transaction log.
Deferred updates translates in a delete/insert. Updating all columns
is always processed as deferred update. You may want to check the
following documents in SQL Server Books Online:
1) Transact SQL Reference, UPDATE statement at the paragraph
"Rules for an Update-in-place"
2) Administration Companion, Troubleshooting, Chapter 23
"The update mode is deferred" and "The update mode is direct"
Best regards,
-- __
Technical Service Manager at Alphasys srl / /\/ /
Microsoft Product Specialist \ \/ /\
Currently rent by Ekar srl \__/\ \
PGP mail encouraged. Finger for key. WWW.ALPHASYS.IT
PGP Fingerprint: BA 9F 9E 9E A9 2C 9D 98 92 54 D1 90 30 1E 8B 94