当前位置:网站首页>nvarchar和varchar的区别
nvarchar和varchar的区别
2022-06-22 14:34:00 【顺其自然~】
1、varchar是非Unicode可变长度类型,nvarchar是Unicode可变长度类型。
2、varchar和nvarchar的最大长度不一样,nvarchar的长度设置必须为1和4000之间。varchar的长度设置必须是1和8000之间。
3、varchar能存储的字节数就是他的长度。nvarchar能存储的字节数是它长度的2倍。
区别:
① 从存储方式上,nvarchar是按字符存储的,varchar是按字节存储的。
② 从存储量来看,varchar是比较省空间的,因为存储的大小就是字节的实际长度,而nvarchar是双字节存储。
③ 使用上,如果存储内容是英文字符而没有汉字或者其他语言,建议使用的是varchar,含有汉字的使用nvarchar,因为nvarchar使用的Unicode编码,统一的编码,会减少乱码出现的几率。
总结:
现在的设备,存储空间的大小已经不受限制。无论是语言的范围,和存储空间的范围,nvarchar都占有很大的优势。
做项目的数据库建议选nvarchar。
原文链接:https://blog.csdn.net/Sunshineoe/article/details/111715231
边栏推荐
- Good wind relies on strength – code conversion practice of accelerating SQL Server Migration with babelfish
- Database connection pool: stress testing
- 微信小程序头像挂件制作
- Scala语言学习-06-传名参数、传值参数、传函数参数的区别
- Show me my personal work list for the past two years. I earn 6K a month in my spare time. It's so delicious to have a sideline
- The 12 SQL optimization schemes summarized by professional "brick moving" old drivers are very practical!
- 数字人民币可以买理财产品了!建行APP在试点地区上线服务专区,实测体验如何?
- 2020年蓝桥杯省赛真题-走方格(DP/DFS)
- Yilian technology rushes to Shenzhen Stock Exchange: annual revenue of RMB 1.4 billion, 65% of which comes from Ningde times
- 小程序开发----自定义有效期缓存
猜你喜欢

Database connection pool: stress testing

I rely on the sideline to buy a house in full one year: the industry you despise will make a lot of money in the next ten years!

C language learning -17- function is passed in as a parameter

模板特例化 template<>

Discourse 新用户可插入媒体的数量

HMS core news industry solution: let technology add humanistic temperature

标准化、最值归一化、均值归一化应用场景的进阶思考

Sdvo:ldso+ semantics, direct French Slam (RAL 2022)

社区文章|MOSN 构建 Subset 优化思路分享

"Software defines the world, open source builds the future" 2022 open atom global open source summit will open at the end of July
随机推荐
Fast and accurate point cloud registration based on minimizing 3D NDT distance
Promoting compatibility and adaptation, enabling coordinated development of gbase may adaptation Express
Is it difficult for flush to open an account? Is it safe to open an account online?
I took a private job and earned 15250. Is it still necessary to do my main business?
(pytorch进阶之路二)word embedding 和 position embedding
向量6(继承)
Promouvoir l'adaptation compatible et permettre le développement collaboratif du Service Express adaptatif gbase en mai
C language learning -17- function is passed in as a parameter
(pytorch advanced path 2) word embedding and position embedding
Exploration and practice of dewu app data simulation platform
Discourse 的信任级别
Community article | mosn building subset optimization ideas sharing
FPGA collects DHT11 temperature and humidity
Found several packages [runtime, main] in ‘/usr/local/Cellar/go/1.18/libexec/src/runtime;
SDVO:LDSO+语义,直接法语义SLAM(RAL 2022)
Meet webassembly again
程序替换函数
Self inspection is recommended! The transaction caused by MySQL driver bug is not rolled back. Maybe you are facing this risk!
鸿世电器冲刺创业板:年营收6亿 刘金贤股权曾被广德小贷冻结
各位学弟学妹,别再看教材了,时间复杂度看这篇就好了