【问题标题】:Msg 8115, Level 16, State 2, Line 2 Arithmetic overflow error converting expression to data type int消息 8115,级别 16,状态 2,第 2 行将表达式转换为数据类型 int 的算术溢出错误
【发布时间】:2015-06-11 05:29:56
【问题描述】:

触发此查询后出现错误。

select COUNT(*) 
from [DB1].dbo.Transaction(nolock) t 
join [DB2].dbo.visits (nolock) v 
on t.V_ID=v.V_ID 
where t.Ct_ID=11  
and t.Timestamp>'06-08-2015' 
and v.C_ID is null

错误:

消息 8115,级别 16,状态 2,行 2 将表达式转换为数据类型 int 的算术溢出错误

【问题讨论】:

  • 尝试使用COUNT_BIG

标签: sql sql-server sql-server-2008


【解决方案1】:

尝试使用COUNT_BIG 而不是COUNT

阅读this article 了解更多信息。此外,this 显示了不同类型的INTs 的限制。

【讨论】:

    猜你喜欢
    • 2020-11-11
    • 2023-03-05
    • 1970-01-01
    • 1970-01-01
    • 2011-10-07
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 2022-01-02
    相关资源
    最近更新 更多