I banged my head against the wall this morning.
The following SQL code and its result do not make any sense to me:
select CONVERT(INT, CONVERT(BINARY(30),2691485888))
that leads to:
-1060082528
What? Why is the result not equal to my original whole?
My goal is to convert an integer to bytes and store those bytes in a database, but without this basic example working, I'm stuck. Can someone explain what I'm doing wrong?
By the way, I am using Sql Server 2005 (9.0.4340)
source
share