Sql Server : Convert from INTEGER (decimal) to HEX and HEX to INTEGER
- Posted by Sqltimes
- On January 24, 2015
- 0 Comments
Quick one today:
Sometimes there is a need to convert data from integer to HEX and from HEX to integer. There are ways to accomplish this and today, this post covers one such ways.
1
2
3
4
5
6
|
-- -- Conversation samples -- SELECT CONVERT ( INT , 0x00F0) AS [Convert_HEX_to_INT] , CONVERT (VARBINARY(8), 15) AS [Convert_INT_to_HEX] GO |
Hope this helps,
_Sqltimes
_Sqltimes
0 Comments