I am trying to understand what the reasoning is behind this update. Has anyone seen anything like this?
--SQL Profile when updating the destination city of a pickup UPDATE dispatch..pickup SET comments=NULL,destcity='City test',changedby='sbruneau',lastupdate='2015-10-08 10:17:11' WHERE pickupid=123456 AND comments='' AND destcity='Scarborough' AND changedby IS NULL AND lastupdate IS NULL --SQL Profile when changing the destination city back UPDATE dispatch..pickup SET destcity='City',lastupdate='2015-10-08 10:17:24' WHERE pickupid=123456 AND destcity='City test' AND lastupdate='2015-10-08 10:17:11'
That's an update that's attempting to check to see if the values are the same as what you thought they were when you started your update. It's checking in case some other person had also run an update before. If they data were changed before your update got there, your update would fail. Presumably the application would either throw an error, or it would cause it to refresh so that you saw the new data.