dbTalk Databases Forums  

arithmetic overflow error

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss arithmetic overflow error in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SCSQL
 
Posts: n/a

Default arithmetic overflow error - 10-17-2003 , 04:50 PM






Hello,

I have a column of datatype int which has about 100000 rows and i am trying
to sum up the column and i am
getting the arithmetic overflow errror

This is the sql

Declare @tot bigint
Select @tot = sum(column1) from tab1
Select @tot




Reply With Quote
  #2  
Old   
Shinichi Yoneda
 
Posts: n/a

Default Re: arithmetic overflow error - 10-17-2003 , 05:05 PM






Hi,

TRY CAST(AS BIGINT)
Quote:
Select @tot = sum(column1) from tab1
Select @tot = sum(CAST(column1 AS BIGINT)) from tab1


-------
SHINICHI YONEDA MXL04371 (AT) nifty (DOT) ne.jp
Microsoft Most Valuable Professional
MVP for SQL Server 2002-2003

"SCSQL" <chalasani (AT) mcleodusa (DOT) net> wrote

Quote:
Hello,

I have a column of datatype int which has about 100000 rows and i am
trying
to sum up the column and i am
getting the arithmetic overflow errror

This is the sql

Declare @tot bigint
Select @tot = sum(column1) from tab1
Select @tot





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.