Export (0) Print
Expand All
Expand Minimize

SqlDataType Enumeration

Specifies the SQL Server built-in data type.

Namespace:  Microsoft.SqlServer.Management.SqlParser.Metadata
Assembly:  Microsoft.SqlServer.Management.SqlParser (in Microsoft.SqlServer.Management.SqlParser.dll)

public enum SqlDataType

Member nameDescription
BigIntA 64-bit signed integer (whole number) data from -2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807).
BinaryA fixed-length byte array ranging between 1 and 8,000 bytes.
BitAn unsigned bit value that can be 0, 1, or a null reference.
CharA fixed-length byte array of non-Unicode (256 code page) characters ranging between 1 and 8,000 characters.
DateRepresents any valid Gregorian calendar date between '0001-01-01' CE and '9999-12-31' CE.
DateTimeA date and time between January 1, 1753 and December 31, 9999 to an accuracy of 3.33 milliseconds.
DateTime2An extension of the existing datetime data type with a large date range and large default fractional precision. Values that represent any valid Gregorian calendar date between ‘0001-01-01’ CE and ‘9999-12-31’ CE combined with any valid time of day based on a 24-hour clock.
DateTimeOffsetA valid Gregorian calendar date between `0001-01-01’ and ‘9999-12-31’ with any valid time of day based on a 24-hour format between ’00:00:00’ and max ’23:59:49.9999999’. Included in the datetimeoffset value is a time zone offset that must be between ‘-14:00’ and ‘+14:00’.
DecimalA fixed precision and fixed scale numeric value between -10^38 +1 and +10^38 -1.
FloatAn 8-byte floating point number within the range of -1.79E +308 through -2.23E - 308, 0 and 2.23E + 308 through 1.79E + 308.
GeographyRepresents data in a round-earth coordinate system. The geography data type stores ellipsoidal (round-earth) data, such as GPS latitude and longitude coordinates.
GeometryRepresents data in a Euclidean (flat) coordinate system.
HierarchyIdA position in a hierarchy.
ImageA variable-length byte array ranging from 0 to 2^31 -1 (or 2,147,483,647) bytes.
IntA 32-bit signed integer (whole number) data from -2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807).
MoneyA decimal value that specifies a currency value ranging from -2^63 (or -922,337,203,685,477.5808) to 2^63 -1 (or +922,337,203,685,477.5807) with an accuracy of 1 in 10,000 of a currency unit.
NCharA fixed-length byte array of Unicode characters ranging between 1 and 4,000 characters.
NoneThe data type is unknown.
NTextA variable-length byte array of Unicode data with a maximum length of 2^30 - 1 (or 1,073,741,823) characters.
NumericA fixed precision and fixed scale numeric value between -10^38 +1 and +10^38 -1.
NVarCharA variable-length byte array of Unicode characters ranging between 1 and 2^63 characters.
NVarCharMaxThe nvarchar(max) data type.
RealA 4-bit floating point number within the range of -3.40E + 38 through -1.18E - 38, 0 and 1.18E - 38 through 3.40E + 38.
SmallDateTimeA date and time between January 1, 1900 and June 6, 2079 to an accuracy of one minute.
SmallIntA 16-bit signed integer data from -2^15 (-32,768) through 2^15 - 1 (32,767).
SmallMoneyA decimal value that specifies a currency value ranging from -214,748.3648 to +214,748.3647 with an accuracy of 1 in 10,000 of a currency unit.
SysNameA system name string.
TextA variable-length byte array of non-Unicode (256 code page) data with a maximum length of 2^31 -1 (or 2,147,483,647) characters.
TimeA time of day based on a 24-hour clock between '00:00:00' and max '23:59:59:9999999'.
TimestampAn automatically generated byte array value, which is guaranteed to be unique within a database.
TinyIntAn 8-bit unsigned integer data from 0 through 255.
UniqueIdentifierA globally unique identifier (or GUID).
VarBinaryA variable-length byte array ranging between 1 and 2^64 bytes.
VarBinaryMaxA varbinary(max) type.
VarCharA variable-length byte array of non-Unicode (256 code page) characters ranging between 1 and 2^64 characters.
VarCharMaxA varchar(max) data type.
VariantA special data type that can contain numeric, string, binary, date data, and the SQL Server values Empty and Null. This data type is assumed if no other type is declared.
XmlAn xml data type.
XmlNodeAn xmlnode data type.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft