当前位置:网站首页>SQL sever基本数据类型详解
SQL sever基本数据类型详解
2022-06-24 09:40:00 【Cpsu】
| 分类及数据特性 | 数据类型(不区分大小写) |
|---|---|
| 整数数据类型 | BIT 、INT、SAMLLINT、TINYINT |
| 货币数据类型 | MONEY、SMALLMONEY |
| 浮点数据类型 | REAL、FLOAT、DECIMAL、NUMERIC |
| 日期/时间数据类型 | DATETIME、SMALLDATETIME、DATA、DATETIME(2)、DATETIMESTAMPOFFSET |
| 字符数据类型 | CHAR、NCHAR(n)、VARCHAR、NVARCHAR(n) |
| 二进制数据类型 | BINARY、VARBINARY |
| 图像和文本数据类型 | TEXT、NTEXT(n)、IMAGE |
字符型数据类型
char: 固定长度,存储ANSI字符,不足的补英文半角空格。
nchar(n): 固定长度,存储Unicode字符,不足的补英文半角空格
varchar: 可变长度,存储ANSI字符,根据数据长度自动变化。
nvarchar(n): 可变长度,存储Unicode字符,根据数据长度自动变化。
如果你肯定存储的数据长度,而且不包中文的,可以选择char类型。
如果肯定存储的数据长度,但可能包括中文,可以选择nchar类型。
如果不确定存储的数据长度,存储只有英文、数字的最好用varchar
如果不确定存储的数据长度,也有可能有中文,可以选择nvarchar类型,在SQL Server2005中也是比较常用的字符数据类型。
原文链接:https://www.cnblogs.com/flyrock/archive/2012/07/08/2581234.html
浮点数据类型参考:
https://www.cnblogs.com/Sungeek/p/12167796.html
日期/时间数据类型参考:
https://blog.csdn.net/qq_39019865/article/details/81061521
整数数据类型参考:
https://www.cnblogs.com/ButterflyEffect/p/8944706.html
图像和文本类型参考:
https://blog.csdn.net/lishimin1012/article/details/50526988
边栏推荐
- Tutorial (5.0) 08 Fortinet security architecture integration and fortixdr * fortiedr * Fortinet network security expert NSE 5
- Ora-16038 ora-19502 ora-00312 troubleshooting
- el-table表格的拖拽 sortablejs
- 形状变化loader加载jsjs特效代码
- Jcim | AI based protein structure prediction in drug discovery: impacts and challenges
- 416 binary tree (first, middle and last order traversal iteration method)
- JS proxy mode
- Ora-28000 error after upgrading Oracle 12C to 19C
- 二叉树第一部分
- PHP file lock
猜你喜欢

CVPR 2022 Oral | 英伟达提出自适应token的高效视觉Transformer网络A-ViT,不重要的token可以提前停止计算

二叉树第一部分

ByteDance Interviewer: talk about the principle of audio and video synchronization. Can audio and video be absolutely synchronized?

微信小程序学习之 实现列表渲染和条件渲染.

Arbre binaire partie 1

indexedDB本地存储,首页优化

如何管理海量的网络基础设施?

Groovy obtains Jenkins credentials through withcredentials

Cicflowmeter source code analysis and modification to meet requirements

Ora-28000 error after upgrading Oracle 12C to 19C
随机推荐
416 binary tree (first, middle and last order traversal iteration method)
canvas管道动画js特效
Engine localization adaptation & Reconstruction notes
In depth study paper reading target detection (VII) Chinese English Bilingual Edition: yolov4 optimal speed and accuracy of object detection
PostgreSQL DBA quick start - source compilation and installation
引擎国产化适配&重构笔记
Honeypot 2 hfish, ehoney
415 binary tree (144. preorder traversal of binary tree, 145. postorder traversal of binary tree, 94. inorder traversal of binary tree)
canvas掉落的小球重力js特效动画
How do novices choose the grade of investment and financial products?
el-table表格的拖拽 sortablejs
观察者模式
十大证券公司哪个佣金最低,最安全可靠?有知道的吗
413 binary tree Foundation
PHP encapsulates a file upload class (supports single file and multiple file uploads)
Thinkphp5 multi language switching project practice
Go language development environment setup +goland configuration under the latest Windows
Nvisual digital infrastructure operation management software platform
微信小程序學習之 實現列錶渲染和條件渲染.
TP5 using post to receive array data times variable type error: solution to array error