开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜