如何在SQL Server中将二进制文件(128)从小端转换为大端?
答案 0 :(得分:11)
尝试这样的事情:
declare @little binary(4)
set @little = 0x02010000
select
@little [bigEndian],
cast(reverse(@little) as binary(4)) [littleEndian]
输出:
bigEndian littleEndian
---------- ------------
0x02010000 0x00000102
(1 row(s) affected)