I've been banging my head against the wall with this one all morning.
The following SQL code and its' result makes no sense to me:
select CONVERT(INT, CONVERT(BINARY(30),2691485888))
which results in:
-1060082528
What? Why doesn't the result equal my original integer?
My whole objective is to convert an integer into bytes and store those bytes into the database, but without getting this basic example to work I am stuck. Can anyone explain what I'm doing wrong?
By the way, I am using Sql Server 2005 (9.0.4340)
INTcan hold.