SQL Server UInt64或十进制(20,0)/十进制(28,0)

编程入门 行业动态 更新时间:2024-10-26 00:32:30
本文介绍了SQL Server UInt64或十进制(20,0)/十进制(28,0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要将社交网络ID存储在数据库中。支持解决方案的2个社交网络中的一个使用无符号64位用户标识符。

I need to store Social network ID in database. One of 2 supported social network for solution use unsigned 64-bit user identifier.

现在我使用小数(28,0)。这是正确的吗?

Now I'm using decimal(28,0). Is it correct?

例如我需要存储ID ='18445016066725229233'

For example I need to store ID='18445016066725229233'

可能支持System.UInt64吗?

May be System.UInt64 is supported?

推荐答案

SQL Server不支持无符号整数作为数据类型,例如 BigInt映射到Int64,而不是UInt64,所以如果你需要处理你有一些选择,一个是使用十进制,或者你可以简单地将它存储在二进制(n)列中。取决于您需要的和应用程序使用情况。如果它仅用作密钥,我个人会使用二进制(n),但这假设您只对值执行相等比较而不进行算术运算。

SQL Server does not support unsigned integers as a data type, for exampleBigInt maps to Int64, not to UInt64, so if you need to deal with this you have some options, one is to use decimal, or you can simple store it in a binary(n) column. Depends on you needs and application usage. If it is only used as a key, personally I would go with binary(n), but this assumes you are only performing equality comparison and noarithmetical operations on the value.

更多推荐

SQL Server UInt64或十进制(20,0)/十进制(28,0)

本文发布于:2023-11-08 13:29:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1569502.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Server   SQL   十进制

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!