SQL Server Data Types
SQL Server supports various data types, and this page summarizes the commonly used data types in SQL Server.
-
BIGINT
BIGINT
is an integer data type that can store integer values larger thanINT
. -
BINARY(N)
TheBINARY(N)
data type is a data type in SQL Server that is used to store fixed-length binary data. -
BIT
The SQL ServerBIT
data type is a data type used to store binary data. -
CHAR(N)
The SQL ServerCHAR(N)
data type is a data type used to store fixed-length strings. -
DATE
In SQL Server database, theDATE
data type represents a value of a date (year, month, day) and can store date values between January 1, 0001 and December 31, 9999. -
DATETIME
TheDATETIME
data type in SQL Server represents a combination of date and time values, used to store dates and times between January 1, 1753 and December 31, 9999. -
DATETIME2
SQL ServerDATETIME2
has a larger time range and higher precision than theDATETIME
data type. -
DECIMAL
TheDECIMAL
data type is one of the data types used in SQL Server to store precise numbers. -
FLOAT(N)
TheFLOAT(N)
data type in SQL Server is used to store floating-point numbers. -
IMAGE
The SQL ServerIMAGE
data type is a data type used for storing binary data. -
INT
TheINT
data type is one of the commonly used integer data types in SQL Server, which is used to store whole numbers. -
MONEY
MONEY
is a data type in SQL Server used to represent monetary values. -
NUMERIC
TheNUMERIC
data type is used to store precise numerical values, which can represent fixed precision and higher precision thanFLOAT
andDOUBLE
. -
REAL
TheREAL
data type in SQL Server is used to store single-precision floating-point numbers. -
SMALLDATETIME
SQL ServerSMALLDATETIME
is a date and time data type that is used to store a combination of date and time. -
SMALLINT
The SQL ServerSMALLINT
data type is used for storing integers and occupies 2 bytes of storage space.SQL ServerSMALLINT
数据类型用于存储整数,占用 2 个字节的存储空间。 -
SMALLMONEY
SMALLMONEY
is a data type in SQL Server used for storing currency values. -
TEXT
TEXT
is a data type in SQL Server used to store text data with a maximum length of 2GB. -
TIME
TheTIME
data type in SQL Server is used to store time values, representing the time of day (hours, minutes, seconds, and milliseconds) without the date part. -
TINYINT
TINYINT
is one of the data types used to store integer values in SQL Server, and it can store integers between 0 and 255. -
UNIQUEIDENTIFIER
In SQL Server,UNIQUEIDENTIFIER
is a data type used to store a globally unique identifier (GUID). -
VARBINARY(N)
TheVARBINARY(N)
data type is used to store variable-length binary data in SQL Server. -
VARCHAR(N)
VARCHAR(N)
is a data type in SQL Server used for storing variable-length strings.