I'm doing some bit manipulations in SQLServer. And have encountered the famous "Arithmetic Overflow" error. The case is, I want it to overflow. How can I tell it to allow overflow and ignore the error?
I'm doing this select:
SELECT CONVERT(bigint, 0x8000000000000000)-1
I want this to return 9223372036854775807 (the biggest bigint), but it returns:
Arithmetic overflow error converting expression to data type bigint.