Reputation: 229
the hex value of 2716455883
is A1E9D3CB
but using
SELECT CONVERT(VARBINARY(8), 2716455883)
getting answer 0x0A000001CBD3E9A1
Upvotes: 2
Views: 6401
Reputation: 107686
SELECT CONVERT(VARBINARY(8), cast(2716455883 as bigint))
It is due to the way SQL Server interprets literals without qualified types. Check this out
select sql_variant_property(2716455883, 'basetype'); -- numeric
select sql_variant_property(2716455883, 'precision'); -- 10
select sql_variant_property(2716455883, 'scale'); -- 0
Upvotes: 7