Skip to content

bulk_update fails when a column is to be updated to None (NULL) #88

Open
@danifus

Description

@danifus

Django: 2.2.17

The error I get when attempting to bulk update a column to None is:

...
  File "/.../site-packages/django/db/models/query.py", line 525, in bulk_update
    self.filter(pk__in=pks).update(**update_kwargs)
  File "/.../site-packages/django/db/models/query.py", line 741, in update
    rows = query.get_compiler(self.db).execute_sql(CURSOR)
...
django.db.utils.ProgrammingError: ('42000', '[42000] [FreeTDS][SQL Server]At least one of the result expressions in a CASE specification must be an expression other than the NULL constant. (8133) (SQLExecDirectW)')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions