how to convert a binary(128) from little endian to big endian in SQL Server?
try something like this:
declare @little binary(4)
set @little = 0x02010000
select
@little [bigEndian],
cast(reverse(@little) as binary(4)) [littleEndian]
OUTPUT:
bigEndian littleEndian
---------- ------------
0x02010000 0x00000102
(1 row(s) affected)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With