SQLite User Forum

how to check update statement really modify a record
Login
> You seem to be saying that an update will not happen if the value will not change. And therefore the change count will not increment. Is that true?

It's trivial to test in the sqlite3 shell:

```
sqlite> create table t(a); insert into t(a) values(1),(2),(3);
sqlite> update t set a=4 where a=1;  -- new value
sqlite> select changes();
1
sqlite> update t set a=4 where a=4;  -- same value as before
sqlite> select changes();
1
sqlite> update t set a=4 where a=8; -- no such record
sqlite> select changes();
0
```

Demonstrably yes: the change count *is* incremented when a row matches an update, regardless of whether the updated record previously had the same value in the updated field(s).