Wednesday, April 22, 2015

Arithmetic overflow error when using DATEADD with [Timestamp] column in sys.dm_os_ring_buffers

I think when you use the expression 1 * (@TimeNow - [timestamp]) and if [timestamp] is bigint, the result of the expression would be bigint as well. If it turns out that the result cannot be converted to INT, then you will run into the same problem.  So you perhaps need to take modulo of that as well.

I didn't quite understand the underlying problem you are trying to solve.  I am simply speaking to the mechanics of the dateadd function, so I might be off-base here.

No comments:

Post a Comment