SQL Server binary(128) convert from little endian to big endian
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)
精彩评论