I have to use the new {ODBC Driver 17 for SQL Server} driver because it supports TLS 1.2 (previously using the {SQL Server} driver. I have a table where the schema can change so I use the OdbcCommandBuilder class to generate the Update statement for me. It's been working great for 5+ years but using the new driver can sometimes generate a Concurrency Exception.
Using the Sql Profiler I narrowed it down to DateTime fields. If you do a select on a DateTime field then you might see, "2021-01-07 19:55:05.207". If you cast that to a DateTime2 then you will see more detail such as "2021-01-07 19:55:05.2070000" or "2021-01-07 19:55:05.2066667". If the detailed version ends in 4 zeros then the Update will succeed. If not then it will give the Concurrency Exception.
I don't see any settings in the OdbcCommandBuilder to affect this. Are there any settings on the database that might affect this? Or is this a bug?