• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 489
  • Last Modified:

Int OverFlow in T-SQL

Experts,

The attached code gives me the following error:

The conversion of the varchar value '20000202008    ' overflowed an int column. Maximum integer value exceeded.


The two last rows of the table in the subquery have this type of larger value.  Tr_Trans_Number is an int, so it needs to compare to this column.  How can I make it work?
SELECT 
c.cu_acct_num,
ct.tr_Trans_number
FROM Customer_Transaction ct 
INNER JOIN Customer c 
ON ct.customer_ID= c.Customer_ID  
where ct.Tr_Trans_Number IN (SELECT Column1 FROM CCLCache.dbo.Comparison_Transaction_Accounts_EXCEL)

Open in new window

0
NigelRocks
Asked:
NigelRocks
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
try this:
SELECT 
c.cu_acct_num,
ct.tr_Trans_number
FROM Customer_Transaction ct 
INNER JOIN Customer c 
ON ct.customer_ID= c.Customer_ID  
where cast(ct.Tr_Trans_Number  as bigint) IN (SELECT cast(Column1 as bigint) FROM CCLCache.dbo.Comparison_Transaction_Accounts_EXCEL)

Open in new window

0
 
NigelRocksAuthor Commented:
You rock!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now