Menu

SQL Server Data Types

SQL Server data types determine which values a column can represent and how they are stored. For date/time fields, compare types by range, fractional-second precision, and time-zone offset support in Microsoft’s date and time types reference. To calculate, extract, or convert date/time values, continue to the SQL Server date and time function reference.

For mixed-type expressions, see the SQL Server data type precedence order to understand which type SQL Server implicitly converts.

The legacy SQL Server timestamp name does not store a date or time; it is a deprecated synonym for rowversion, an automatically generated value used to detect row changes.

For hierarchical documents, see the SQL Server xml data type, including typed XML, query methods, and XML indexes.

For GUID keys and generated identifiers, see uniqueidentifier and the NEWID() and NEWSEQUENTIALID() references.

For native JSON storage introduced in SQL Server 2025, see the json data type, including its platform availability and current indexing limitations.

  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. Data Type Precedence

    See SQL Server’s data type precedence order and learn when implicit conversions can change an expression or raise an error.
  6. DATE

    SQL Server DATE stores calendar dates from 0001-01-01 through 9999-12-31, without a time of day or time-zone offset.
  7. DATETIME

    SQL Server DATETIME stores dates from 1753 through 9999 and rounds fractional seconds to .000, .003, or .007. Learn its limits and alternatives for new work.
  8. DATETIME2

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

    SQL Server DATETIMEOFFSET stores a date and time with a UTC offset, preserves that offset, and compares values by their UTC instant.
  10. DECIMAL

    SQL Server DECIMAL and NUMERIC are synonyms for fixed-precision numbers; precision ranges from 1 to 38 and scale controls fractional digits.
  11. FLOAT(N)

    SQL Server FLOAT stores approximate binary floating-point values. Its n parameter sets mantissa bits, not decimal digits, and defaults to 53.
  12. IMAGE

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

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

    Learn where SQL Server’s native json type is available, how it differs from JSON text in nvarchar, and its validation and indexing limits.
  15. MONEY

    SQL Server MONEY stores values to four fractional decimal places. Microsoft recommends DECIMAL rather than MONEY for currency calculations.
  16. NUMERIC

    SQL Server NUMERIC and DECIMAL are synonyms for fixed-precision numbers; precision ranges from 1 to 38 and scale controls fractional digits.
  17. REAL

    SQL Server REAL is an approximate 4-byte type and a synonym for FLOAT(24), with about 7 significant decimal digits.
  18. ROWVERSION

    Learn why SQL Server TIMESTAMP is a deprecated ROWVERSION synonym, how its 8-byte value tracks row changes, and use it for optimistic concurrency.
  19. SMALLDATETIME

    SQL Server SMALLDATETIME stores dates from 1900 through 2079 and rounds seconds to the nearest minute; see its limits and query examples.
  20. SMALLINT

    The SQL Server SMALLINT data type stores 16-bit signed integers between -32,768 and 32,767, occupying 2 bytes of storage space.
  21. SMALLMONEY

    SQL Server SMALLMONEY stores values from -214,748.3648 to 214,748.3647 with four fractional decimal places in 4 bytes.
  22. TEXT

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

    SQL Server TIME stores a time of day without a date or time zone. Its fractional-second scale ranges from 0 to 7 and defaults to 7.
  24. 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.
  25. UNIQUEIDENTIFIER

    Learn how SQL Server uniqueidentifier stores GUIDs, generate values with NEWID or NEWSEQUENTIALID, and avoid conversion and ordering pitfalls.
  26. VARBINARY(N)

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

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

    Learn when to use SQL Server’s xml data type, how typed and untyped XML differ, and how to query XML with XQuery methods.