What is the advantage of using hexadecimal values instead of
integers?
Hexadecimal is a slightly shorter representation. For example, the following two values are identical:
999999999 DEX
3B9AC9FF HEX
You also have a better view of the bit distribution, since each position in hexadecimal equals 4 bits:
3 B 9 A C 9 F F HEX
0011 1011 1001 1010 1100 1001 1111 1111 BIN
What kind of column is appropriate in this case: string (varchar), binary,
other
Usually numeric, but can be binary. Hexa is just a representation; is the case of the GUID type, which SQL Server stores as a varbinary(16)
.
For an example of this type of conversion, see this answer in Stack Overflow: link