ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

SqlServer Arithmetic overflow error converting expression to data type int

SqlServer Arithmetic overflow error converting expression to data type int

现象

Microsoft.Data.SqlClient.SqlException (0x80131904): Arithmetic overflow error converting expression to data type int.at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)at Microsoft.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)at Microsoft.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)at Microsoft.Data.SqlClient.SqlDataReader.ReadAsyncExecute(Task task, Object state)at Microsoft.Data.SqlClient.SqlDataReader.InvokeAsyncCall[T](SqlDataReaderBaseAsyncCallContext`1 context)

原因

排查sql中是否有SUM(), COUNT()等操作,它们的值是不是大于int范围了, 即2147483647

返回列表