Format description:
Data Type
Description
Same meaning
Bit
1 bit; Value: 0 or 1
Int
Integer
4 bytes; value range:-2 ^ 31 ~ 2 ^ 31-1
Smallint
2 bytes; value range:-2 ^ 15 ~ 2 ^ 15-1
Tinyint
1 byte; value range: 0 ~ 255
Decimal (P, S)
Numeric data with a fixed precision of P and a width of S
Numeric
Money
8 bytes, which stores the currency type; value range:-2 ^ 63 ~ 2 ^ 63-1
Small money
4 bytes, which stores the currency type. The value ranges from-214748.3648 ~ + 214748.3647 approximate numeric data types
Float (N)
N in 1 ~ Between 24, 4 bytes, 7-bit precision
N = 1 ~ 7 is real
N in 25 ~ Between 53, 8 bytes, 15-bit precision
= 8 ~ 15 is float
Datetime
8 bytes to describe the date and time of a day. The value is accurate to 1/300 seconds.
Smalldatetime
4 bytes, which describes the date and time of a day, precise to minutes
Cursor
References to a cursor
Timestamp
8 bytes, unique data stored in the database
Uniqueidentifier
16 bytes, stores the Globally Unique Identifier (guid)
Char (N)
The fixed length of a non-Unicode string, n = 1 ~ 8000
Character (N)
Varchar (N)
Variable Length, non-Unicode string n = 1 ~ 8000
Char varying (N)
Text
Variable-length non-Unicode data in the server code page. The maximum length is 23-1 Characters
Nchar
Unicode string of fixed length n = 1 ~ 4000
National Character (N ),
National char (N)
Nvarchar
Unicode string of fixed length n = 1 ~ 4000
National Character varying (N)
Ntext
Unicode data with a variable length. The maximum length is-1 characters.
National text
Binary (N)
Binary data of fixed length, where n ranges from 1 ~ The storage space is n + 4 bytes.
Varbinary (N)
Variable Length binary data, n = 1 ~ 8000
Binary varying (N)
Tmage
Variable-length binary data; Size: 0 ~ 231-1
Note:
1) For numeric data types, width (scale) refers to the number of digits stored after the decimal point, while precision refers to the number of digits that can be stored including the decimal point.
2) the storage width of money and small money is 4.
3) The timestamp column value is automatically updated when each row is updated. The timestamp Column cannot be a part of a keyword or keyword.
4) Arithmetic Operators (such as + and-) cannot be used to uniquely identify data types. Such data types can only use equal comparison operations. Unicode is the standard for consistent data storage for all character sets. It uses twice the storage space of Non-Unicode data storage.