So, I'm back to work and double checked if the "ID" is the primary key. And
in fact, it is defined as "IDENTITY(1, 1)" with an additional "CONSTRAINT
PK_Measurement" PRIMARY KEY (ID)" constraint. So on this side this should
be correct.
However, there is a trigger defined for this table and I
triggers, ah. Maybe? that seems inconvenient. it would be good if you could
adjust the triggers to not affect the rowcount of the original statement,
otherwise you'd have to set supports_sane_rowcount=False on your engine:
engine.dialect.supports_sane_rowcount =False
On Fri, Jun 26, 2020, at
I think ID is the only primary key of the Measurements table, but I can
double check this on Monday. I used sqlacodegen to create the initial
models, so if this tool correctly detects primary keys, the Measurement
model should match the table definition.
I also tried to execute the follwing
hi -
does your Measurement table have a primary key constraint present, and does
this primary key constraint consist of exactly the "ID" column only and no
other columns? it would appear you have not mapped the primary key correctly.
On Fri, Jun 26, 2020, at 9:57 AM, jue...@gmail.com wrote:
I'm currently working with sqlalchemy (Version 1.3.18) to access a
Microsoft Server SQL Database (Version: 14.00.3223). I use pyodbc
(Version 4.0.30)
When I try to update a single object and try to update and commit the
object, I run into a StaleDataError:
StaleDataError: UPDATE statement on