当前位置:网站首页>Detailed explanation of SQL Sever basic data types
Detailed explanation of SQL Sever basic data types
2022-06-24 10:39:00 【Cpsu】
| Classification and data characteristics | data type ( Case insensitive ) |
|---|---|
| Integer data type | BIT 、INT、SAMLLINT、TINYINT |
| Currency data types | MONEY、SMALLMONEY |
| Floating point data types | REAL、FLOAT、DECIMAL、NUMERIC |
| date / Time data type | DATETIME、SMALLDATETIME、DATA、DATETIME(2)、DATETIMESTAMPOFFSET |
| Character data type | CHAR、NCHAR(n)、VARCHAR、NVARCHAR(n) |
| Binary data type | BINARY、VARBINARY |
| Image and text data types | TEXT、NTEXT(n)、IMAGE |
Character data type
char: Fixed length , Storage ANSI character , Fill in the blanks .
nchar(n): Fixed length , Storage Unicode character , Fill in the blanks
varchar: Variable length , Storage ANSI character , Automatically change according to the length of the data .
nvarchar(n): Variable length , Storage Unicode character , Automatically change according to the length of the data .
If you are sure of the length of the stored data , And it doesn't include Chinese , You can choose char type .
If the length of the stored data is certain , But it may include Chinese , You can choose nchar type .
If you are unsure of the length of the stored data , Storage only in English 、 The best use of numbers varchar
If you are unsure of the length of the stored data , There may also be Chinese , You can choose nvarchar type , stay SQL Server2005 Is also a commonly used character data type .
Link to the original text :https://www.cnblogs.com/flyrock/archive/2012/07/08/2581234.html
Floating point data type reference :
https://www.cnblogs.com/Sungeek/p/12167796.html
Currency data type reference :
https://docs.microsoft.com/zh-cn/sql/t-sql/data-types/money-and-smallmoney-transact-sql?view=sql-server-2017
date / Time data type reference :
https://blog.csdn.net/qq_39019865/article/details/81061521
Integer data type reference :
https://www.cnblogs.com/ButterflyEffect/p/8944706.html
Image and text type reference :
https://blog.csdn.net/lishimin1012/article/details/50526988
边栏推荐
- 24. 图像拼接大作业
- Flink cluster construction and enterprise level yarn cluster construction
- Illustration miscellaneous [for archiving to prevent loss]
- 图解杂项【防止丢失进行存档用的】
- 6. package management business development
- Leetcode-1051: height checker
- What you must know about distributed systems -cap
- 23. opencv - image mosaic project
- 【资源分享】2022年环境工程与生物技术国际会议(CoEEB 2022)
- [JS reverse sharing] community information of a website
猜你喜欢
随机推荐
抓包工具charles實踐分享
js中对象合并的4种方式,对象合并的4种方法
Customize the toolbars of the kindeditor editor. Items removes unnecessary toolbars or retains some toolbars
Differences among cookies, session, localstorage and sessionstorage
线程的六种状态
Uniapp implementation forbids video drag fast forward
leetCode-498: 对角线遍历
3. addition, deletion, modification and query of employees
JMeter接口测试工具基础— 使用Badboy录制JMeter脚本
Quick completion guide for mechanical arm (I): development overview of mechanical arm
多线程的应用 - 提升效率
Leetcode-2221: triangular sum of arrays
tf. contrib. layers. batch_ norm
2022 the most complete and detailed JMeter interface test tutorial and detailed interface test process in the whole network - JMeter test plan component (thread < user >)
283.移动零
tf. errors
leetCode-面试题 16.06: 最小差
机械臂速成小指南(零):指南主要内容及分析方法
[IEEE publication] 2022 International Conference on industrial automation, robotics and Control Engineering (iarce 2022)
The difference between static link library and dynamic link library









