When you convert a binary or varbinary type to numeric or decimal, you must specify the “00” or “01” values after the “0x” digit; otherwise, the conversion fails.
In binary and varbinary data strings, the first two digits after “0x” represent the binary type: “00” represents a positive number and “01” represents a negative number.
select convert(numeric (38, 18),0x000000000000000006b14bd1e6eea0000000000000000000000000000000)
---------- 123.456000
select convert(binary,convert(numeric(38, 18), 123.456))
-------------------------------------------------------------- 0x000000000000000006b14bd1e6eea0000000000000000000000000000000