I am getting an error after firing this query.
在触发这个查询之后,我将得到一个错误。
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
Error:
错误:
Msg 8115, Level 16, State 2, Line 2 Arithmetic overflow error converting expression to data type int
msg8115,级别16,状态2,第2行算术溢出错误将表达式转换为数据类型int
1 个解决方案
#1
5
Try using COUNT_BIG
instead of COUNT
.
尝试使用COUNT_BIG而不是COUNT。
Read this article for more information. Additionally, this shows the limits for the different types of INT
s.
更多信息请阅读本文。此外,这显示了不同类型int的限制。
#1
5
Try using COUNT_BIG
instead of COUNT
.
尝试使用COUNT_BIG而不是COUNT。
Read this article for more information. Additionally, this shows the limits for the different types of INT
s.
更多信息请阅读本文。此外,这显示了不同类型int的限制。