开发者

SQL Server Hexadecimal data type

开发者 https://www.devze.com 2023-01-22 22:32 出处:网络
I\'m looking for a datatype in SQL Server that stores data as hexadecimal rather than int, but can开发者_开发问答\'t find anything similar. Surely there is a hexadecimal datatype?Store it as an INT an

I'm looking for a datatype in SQL Server that stores data as hexadecimal rather than int, but can开发者_开发问答't find anything similar. Surely there is a hexadecimal datatype?


Store it as an INT and use the HEX() function to convert it.

There's no native storage for hexadecimal in SQL Server.

EDIT:

You can also store hex data as VARBINARY, but there is still a conversion required, and there are data integrity issues with that method as well.

0

精彩评论

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