posted 10 years ago
Consider there is a library application. The user may select and edit the book details. There are 25 fields defined for each book. A user modifies one or two fields (say Book Edition and Publishing date) and saves the edited book details. Now in my Data Access Layer should i try to identify the changed data and just update the fields that have been changed
Update BookDetails
Set edition = '2010',
publisher = 'Prentice Hall'
where isbn = '96X31511134C'
or
simply try and update all fields in the database
Update BookDetails
Set
title = "Some Title"
author = "Some Author"
edition = '2010',
publisher = 'Prentice Hall'
language = 'Eng(US)'
.
.
.
. set all 24 fields
where isbn = '96X31511134C'
For the first i need to do some more work at all layers and UI also to identify the list of field that have changed. Which is usually a more sensible approach.