April 8, 2009 at 1:31 am
Hello,
when I try the following sql I get an error:
select sum(datalength(memTest))
from tblTest
Arithmetic overflow error converting expression to data type int
Has anyone an idea?
Thanks.
April 8, 2009 at 1:58 am
Hi,
According to BOL, DataLength returns either an int or bigint depending upon the type of the field it is examining. So what is the definition of 'memTest' and how many rows are there?
It could be that it is going to return an int, but the accumulated value is too large for such a field.
BrainDonor
April 8, 2009 at 2:26 am
Try this,
select sum(Convert(bigint,datalength(memTest),0))
from tblTest
"Don't limit your challenges, challenge your limits"
April 8, 2009 at 3:46 am
Thanks kruti, it works.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply