[SQL Server] Update datetime2 column does not work

未关闭
#573 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
fsharp, sql
领域
databases

调研方向

未指定源文件或测试。首先使用所示的 SqlTypeProvider 查询和 SubmitUpdates 调用重现 SQL Server 2016 案例,然后跟踪 datetime2(7) 赋值是如何被检测并持久化的。完成的标准是现有行得到更新,或者引发明确的更新错误,而不是静默完成。

由索引模型根据 Issue 内容生成。

描述

Description

I cannot update a row containing a datetime2(7) column in SQL Server.
Updates on other datatypes, for example plain int works well.
Inserts with DateTime into this same table works well.

Repro steps
  • Sql server 2016
  • SqlTypeProvider 1.1.50
type MyDb = SqlDataProvider<ConnectionStringName = "ConnStringInAppConfig", DatabaseVendor = Common.DatabaseProviderTypes.MSSQLSERVER, UseOptionTypes = true>

let ctx = MyDb.GetDataContext()
let entityToUpdate = query { from e in ctx.Dbo.MyTable do where (e.Id = myId) select e }
e.ValidFromDate <- new DateTime(2018, 08, 08)
ctx.SubmitUpdates()
Expected behavior

The column is updated, or else an error is raised that it could not be updated.

Actual behavior

Silently finishes, nothing is updated. No "pendingchanges" remain.

Known workarounds

Delete row and recreate it.

Related information
  • SQL Server 2016
  • Client on Win10, server on Windows Server 2012
  • Latest released version on nuget
  • NET Framework 4.6.1
主要语言
F#
星标
627
派生
147
平均合并
2 小时 2 分钟
30 天内合并 PR
1

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fsprojects/SQLProvider 的其他 Issue

查看 fsprojects/SQLProvider 的全部 Issue

相似的 Issue

更多 Databases Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。