Open
Description
Repo.Update fails when the changeset includes a nil date value with an intent to update a date field to set to null. The error message states:
[2021-07-06 16:34:24.100] [debug] Line 1 (Error 8180): Statement(s) could not be prepared.
** (Tds.Error) Line 1 (Error 257): Implicit conversion from data type varbinary to date is not allowed. Use the CONVERT function to run this query.
(ecto_sql 3.6.1) lib/ecto/adapters/sql.ex:749: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto 3.6.1) lib/ecto/repo/schema.ex:717: Ecto.Repo.Schema.apply/4
(ecto 3.6.1) lib/ecto/repo/schema.ex:426: anonymous fn/15 in Ecto.Repo.Schema.do_update/4
The changeset looks like
#Ecto.Changeset<
action: nil,
changes: %{date_completed: nil},
errors: [],
data: #MyApp.MyModel<>,
valid?: true
>