SQL Server Data Types

SQL Server supports various data types, and this page summarizes the commonly used data types in SQL Server.

  1. BIGINT

    BIGINT is an integer data type that can store integer values larger than INT.
  2. BINARY(N)

    The BINARY(N) data type is a data type in SQL Server that is used to store fixed-length binary data.
  3. BIT

    The SQL Server BIT data type is a data type used to store binary data.
  4. CHAR(N)

    The SQL Server CHAR(N) data type is a data type used to store fixed-length strings.
  5. DATE

    In SQL Server database, the DATE data type represents a value of a date (year, month, day) and can store date values between January 1, 0001 and December 31, 9999.
  6. DATETIME

    The DATETIME 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.
  7. DATETIME2

    SQL Server DATETIME2 has a larger time range and higher precision than the DATETIME data type.
  8. DECIMAL

    The DECIMAL data type is one of the data types used in SQL Server to store precise numbers.
  9. FLOAT(N)

    The FLOAT(N) data type in SQL Server is used to store floating-point numbers.
  10. IMAGE

    The SQL Server IMAGE data type is a data type used for storing binary data.
  11. INT

    The INT data type is one of the commonly used integer data types in SQL Server, which is used to store whole numbers.
  12. MONEY

    MONEY is a data type in SQL Server used to represent monetary values.
  13. NUMERIC

    The NUMERIC data type is used to store precise numerical values, which can represent fixed precision and higher precision than FLOAT and DOUBLE.
  14. REAL

    The REAL data type in SQL Server is used to store single-precision floating-point numbers.
  15. SMALLDATETIME

    SQL Server SMALLDATETIME is a date and time data type that is used to store a combination of date and time.
  16. SMALLINT

    The SQL Server SMALLINT data type is used for storing integers and occupies 2 bytes of storage space.SQL Server SMALLINT 数据类型用于存储整数,占用 2 个字节的存储空间。
  17. SMALLMONEY

    SMALLMONEY is a data type in SQL Server used for storing currency values.
  18. TEXT

    TEXT is a data type in SQL Server used to store text data with a maximum length of 2GB.
  19. TIME

    The TIME 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.
  20. 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.
  21. UNIQUEIDENTIFIER

    In SQL Server, UNIQUEIDENTIFIER is a data type used to store a globally unique identifier (GUID).
  22. VARBINARY(N)

    The VARBINARY(N) data type is used to store variable-length binary data in SQL Server.
  23. VARCHAR(N)

    VARCHAR(N) is a data type in SQL Server used for storing variable-length strings.