当前位置:网站首页>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
边栏推荐
- 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 >)
- Six states of threads
- Uniapp implementation forbids video drag fast forward
- 牛客-TOP101-BM28
- Quick completion guide for mechanical arm (II): application of mechanical arm
- Niuke-top101-bm28
- JMeter接口测试工具基础— 使用Badboy录制JMeter脚本
- Appium自动化测试基础 — 移动端测试环境搭建(一)
- 跨域概述,简单积累
- Hbuilder makes hero skin lottery games
猜你喜欢

Uniapp develops a wechat applet to display the map function, and click it to open Gaode or Tencent map.

The difference between the sleep () method and the wait () method of a thread

charles抓包工具使用教程

leetCode-498: 對角線遍曆

Solve the timeout of Phoenix query of dbeaver SQL client connection

Leetcode-2221: triangular sum of arrays

Outils de capture de paquets

Role of message queuing

【IEEE出版】2022年自然语言处理与信息检索国际会议(ECNLPIR 2022)

88. merge ordered arrays
随机推荐
Spark提交参数--files的使用
24. 图像拼接大作业
Learn to use PHP to implement unlimited comments and unlimited to secondary comments solutions
[IEEE publication] 2022 International Conference on service robots (iwosr 2022)
Quick completion guide for mechanical arm (I): development overview of mechanical arm
[EI分享] 2022年第六届船舶,海洋与海事工程国际会议(NAOME 2022)
SSM整合
Stack Title: exclusive time of function
JMeter interface test tool foundation - sampler (II)
Spark submission parameter -- use of files
88.合并有序数组
Learn to use the phpstripslush function to remove backslashes
Solve the timeout of Phoenix query of dbeaver SQL client connection
numpy. logical_ and()
charles抓包工具使用教程
Practice sharing of packet capturing tool Charles
Sort out interface performance optimization skills and kill slow code
tf. errors
Niuke-top101-bm29
Uniapp implementation forbids video drag fast forward