|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, June 12, 2009 8:16 AM
Points: 38,
Visits: 129
|
|
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.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 3:05 AM
Points: 1,400,
Visits: 6,896
|
|
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
BrainDonor Linkedin
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Monday, May 09, 2011 2:49 AM
Points: 536,
Visits: 412
|
|
Try this,
select sum(Convert(bigint,datalength(memTest),0)) from tblTest
"Don't limit your challenges, challenge your limits"
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, June 12, 2009 8:16 AM
Points: 38,
Visits: 129
|
|
|
|
|