How to fix arithmetic overflow error converting expression to data type bigint for my Trellix EPO server

Gene Abutin 0 Reputation points
2023-06-20T17:21:53.6866667+00:00

Hello, I manage a Trellix EPO server here at work which records data to SQL Server and when I try to upgrade to the latest EPOI software, I get the following error below. Can somebody kindly give me step by step instructions on how to fix this? I am a SQL beginner and have never encountered this error before.

Error: Failed to execute sql –update the existing records in the table.update pp set verproductversion=cast(convert(varchar,verproductmajor),3) +right (‘000000’ +convert (varchar, verproductrevision), 6) +right(‘000000’ +convert varchar, verproductbuild),6) as bigint) from EPOProductpropertiesmt ppjoin epoproductversionsmt as v on v.parentid = pp.autoid execution failed with error : requesterror: arithmetic overflow error converting expression to data type bigint

SQL Server Other
{count} votes

2 answers

Sort by: Most helpful
  1. Naomi Nosonovsky 8,431 Reputation points
    2023-06-20T17:47:28.9366667+00:00

    Can you post the exact update statement that failed? The one you posted has syntax errors.

    I can simulate the error with the following:

    SELECT cast(convert(varchar,9999999,3) +right ('000000' +convert (varchar, '999999'), 6) +right('000000' +convert (VARCHAR, '999999'),6) as bigint)
    

    You may need to use the same RIGHT expression for the first portion of the string.


  2. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-06-20T21:53:58.2933333+00:00

    If I understand this, you get this error when trying to upgrade a third-party product. I think you should open a support case with the software vendor. We may be able to help you to fix the problematic statement, but the fix may not be correct in the bigger scheme of things and cause more problems down the road.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.