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.
-
BIGINT
BIGINTis 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 ServerBITdata 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. -
Data Type Precedence
See SQL Server’s data type precedence order and learn when implicit conversions can change an expression or raise an error. -
DATE
SQL Server DATE stores calendar dates from 0001-01-01 through 9999-12-31, without a time of day or time-zone offset. -
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. -
DATETIME2
SQL ServerDATETIME2has a larger time range and higher precision than theDATETIMEdata type. -
DATETIMEOFFSET
SQL Server DATETIMEOFFSET stores a date and time with a UTC offset, preserves that offset, and compares values by their UTC instant. -
DECIMAL
SQL Server DECIMAL and NUMERIC are synonyms for fixed-precision numbers; precision ranges from 1 to 38 and scale controls fractional digits. -
FLOAT(N)
SQL Server FLOAT stores approximate binary floating-point values. Its n parameter sets mantissa bits, not decimal digits, and defaults to 53. -
IMAGE
The SQL ServerIMAGEdata type is a data type used for storing binary data. -
INT
TheINTdata type is one of the commonly used integer data types in SQL Server, which is used to store whole numbers. -
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. -
MONEY
SQL Server MONEY stores values to four fractional decimal places. Microsoft recommends DECIMAL rather than MONEY for currency calculations. -
NUMERIC
SQL Server NUMERIC and DECIMAL are synonyms for fixed-precision numbers; precision ranges from 1 to 38 and scale controls fractional digits. -
REAL
SQL Server REAL is an approximate 4-byte type and a synonym for FLOAT(24), with about 7 significant decimal digits. -
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. -
SMALLDATETIME
SQL Server SMALLDATETIME stores dates from 1900 through 2079 and rounds seconds to the nearest minute; see its limits and query examples. -
SMALLINT
The SQL ServerSMALLINTdata type stores 16-bit signed integers between -32,768 and 32,767, occupying 2 bytes of storage space. -
SMALLMONEY
SQL Server SMALLMONEY stores values from -214,748.3648 to 214,748.3647 with four fractional decimal places in 4 bytes. -
TEXT
TEXTis a data type in SQL Server used to store text data with a maximum length of 2GB. -
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. -
TINYINT
TINYINTis one of the data types used to store integer values in SQL Server, and it can store integers between 0 and 255. -
UNIQUEIDENTIFIER
Learn how SQL Server uniqueidentifier stores GUIDs, generate values with NEWID or NEWSEQUENTIALID, and avoid conversion and ordering pitfalls. -
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. -
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.