SQL Aritmethic Overflow

Handian Sudianto 6,096 Reputation points
2023-06-20T08:34:17.84+00:00

Hello,

i do query using below SQL syntax and i got the result

User's image

but if i uncomment the 'where' syntax i got error

User's image

I very strange why the error say about arithmetic since the filter only using string and not use any calculation.

SQL Server Other
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2023-06-20T08:51:43.5666667+00:00

    I very strange why the error say about arithmetic since the filter only using string and not use any calculation.

    Without knowing the table design = data types per column we even can't guess it.

    Check the data type of every used column.

    0 comments No comments

  2. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-06-20T22:12:44.1966667+00:00

    Is NetFlowFlows_ViewByConversation a table or a view? And if is is a view, does it have its own WHERE clause and filtering?

    When you query a view, the view is only a macro that is expanded into the query, and the optimizer works with the expanded query. When you added the query filter, you may have gotten entirely different execution plan altogether, so that an expression that logically is filtered out, is now computed before the filter and therefore you get this error.

    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.