开发者

SQL Server binary(128) convert from little endian to big endian

开发者 https://www.devze.com 2022-12-22 06:38 出处:网络
how to convert a binary(128) fromlittle endian to big endian in SQL Server开发者_运维技巧?try something like this:

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)
0

精彩评论

暂无评论...
验证码 换一张
取 消