8000 Implicit conversion from data type varbinary to date is not allowed · Issue #124 · elixir-ecto/tds · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Implicit conversion from data type varbinary to date is not allowed #124
Open
@puruzio

Description

@puruzio

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
>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0