当前位置:网站首页>The difference between SQL Server char nchar varchar and nvarchar
The difference between SQL Server char nchar varchar and nvarchar
2022-07-05 15:09:00 【Blue sky ⊙ white clouds】
- char: Fixed length ,
Storage ansi character
, Fill in the blanks . - nchar: Fixed length ,
Storage Unicode character
, Fill in the blanks . - varchar(n): The length is n Bytes of
Variable length and not Unicode Character data of
.n It has to be between 1 and 8,000 Value between . The storage size is the actual length of the bytes of the input data , instead of n Bytes . - nvarchar(n): contain n A character
Variable length Unicode Character data
.n The value of must be between 1 And 4,000 Between . The storage size of a byte is twice the number of characters entered . - TEXT
text Store variable lengthNot Unicode data
, Maximum length is 2^31-1(2,147,483,647) Characters . - NCHAR、NVARCHAR、NTEXT
These three are more than the first three in terms of names "N". and char、varchar Compare ,nchar、nvarchar Maximum storage 4000 Characters , Whether in English or Chinese ; and char、varchar It can store at most 8000 English ,4000 The Chinese characters . It can be seen thatUse nchar、nvarchar Don't worry about whether the input character is English or Chinese , More convenient
, But there is some loss in the amount of English stored .
So generally speaking , If it contains Chinese characters , use nchar/nvarchar, If it's pure English and numbers , use char/varchar.
边栏推荐
- Crud of MySQL
- 【华为机试真题详解】欢乐的周末
- 可转债打新在哪里操作开户是更安全可靠的呢
- Run faster with go: use golang to serve machine learning
- Garbage collection mechanism of PHP (theoretical questions of PHP interview)
- easyOCR 字符識別
- Long list optimized virtual scrolling
- anaconda使用中科大源
- Fr exercise topic - simple question
- JMeter performance test: serveragent resource monitoring
猜你喜欢
随机推荐
PHP high concurrency and large traffic solution (PHP interview theory question)
How to solve the problem of garbled code when installing dependency through NPM or yarn
危机重重下的企业发展,数字化转型到底是不是企业未来救星
Fr exercise topic --- comprehensive question
Surpass palm! Peking University Master proposed diverse to comprehensively refresh the NLP reasoning ranking
729. My schedule I: "simulation" & "line segment tree (dynamic open point) &" block + bit operation (bucket Division) "
超越PaLM!北大硕士提出DiVeRSe,全面刷新NLP推理排行榜
Common MySQL interview questions
Interpretation of Apache linkage parameters in computing middleware
Photoshop plug-in - action related concepts - actions in non loaded execution action files - PS plug-in development
[recruitment position] Software Engineer (full stack) - public safety direction
Anaconda uses China University of science and technology source
面试突击62:group by 有哪些注意事项?
可转债打新在哪里操作开户是更安全可靠的呢
easyOCR 字符識別
Magic methods and usage in PHP (PHP interview theory questions)
Type declaration of all DOM elements in TS
[recruitment position] infrastructure software developer
R 熵权法计算权重及综合得分
Visual task scheduling & drag and drop | scalph data integration based on Apache seatunnel