Tuesday, May 23, 2006

Arithmetic overflow error converting expression to data type int  [Digg.com This!]

In SQL Server I get the following error when I try to COUNT(*) rows in very large tables:

"Arithmetic overflow error converting expression to data type int."

Googling and sifting through pages about the same problem for SUM( ), I found you can use this function:

COUNT_BIG(*)

This uses a bigint rather than int for storage.

0 Comments:

Post a Comment

<< Home