SqlDataType SqlDataType SqlDataType Enum

Definition

SQL Server built-in data types

public enum SqlDataType
type SqlDataType = 
Public Enum SqlDataType
Inheritance
SqlDataTypeSqlDataTypeSqlDataType

Fields

BigInt BigInt BigInt 1

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).

Binary Binary Binary 20

Fixed-length binary data with a maximum length of 8,000 bytes.

Bit Bit Bit 5

Integer data with either a 1 or 0 value.

Char Char Char 14

Fixed-length non-Unicode character data with a maximum length of 8,000 characters.

Cursor Cursor Cursor 23

A reference to a cursor.

Date Date Date 29

Date-only

DateTime DateTime DateTime 12

Date and time data from January 1, 1753, through December 31, 9999, with an accuracy of three-hundredths of a second, or 3.33 milliseconds.

DateTime2 DateTime2 DateTime2 31

Combination of data and time types, better precision than DataTime

DateTimeOffset DateTimeOffset DateTimeOffset 32

Same as DateTime2 with timezone offset added

Decimal Decimal Decimal 6

Fixed precision and scale numeric data from -10^38 +1 through 10^38 -1.

Float Float Float 10

Floating precision number data with the following valid values: -1.79E + 308 through -2.23E - 308, 0 and 2.23E + 308 through 1.79E + 308.

Image Image Image 22

Variable-length binary data with a maximum length of 2^31 - 1 (2,147,483,647) bytes.

Int Int Int 2

Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647).

Money Money Money 8

Monetary data values from -2^63 (-922,337,203,685,477.5808) through 2^63 - 1 (+922,337,203,685,477.5807), with accuracy to a ten-thousandth of a monetary unit.

NChar NChar NChar 17

Fixed-length Unicode data with a maximum length of 4,000 characters.

NText NText NText 19

Variable-length Unicode data with a maximum length of 2^30 - 1 (1,073,741,823) characters.

Numeric Numeric Numeric 7

Functionally equivalent to decimal.

NVarChar NVarChar NVarChar 18

Variable-length Unicode data with a maximum length of 4,000 characters. sysname is a system-supplied user-defined data type that is functionally equivalent to nvarchar(128) and is used to reference database object names.

Real Real Real 11

Floating precision number data with the following valid values: -3.40E + 38 through -1.18E - 38, 0 and 1.18E - 38 through 3.40E + 38.

Rowversion Rowversion Rowversion 33

(Alias for Timestamp) A database-wide unique number that gets updated every time a row gets updated.

SmallDateTime SmallDateTime SmallDateTime 13

Date and time data from January 1, 1900, through June 6, 2079, with an accuracy of one minute.

SmallInt SmallInt SmallInt 3

Integer data from -2^15 (-32,768) through 2^15 - 1 (32,767).

SmallMoney SmallMoney SmallMoney 9

Monetary data values from -214,748.3648 through +214,748.3647, with accuracy to a ten-thousandth of a monetary unit.

Table Table Table 25

A special data type used to store a result set for later processing.

Text Text Text 16

Variable-length non-Unicode data with a maximum length of 2^31 - 1 (2,147,483,647) characters.

Time Time Time 30

Time only

Timestamp Timestamp Timestamp 26

A database-wide unique number that gets updated every time a row gets updated.

TinyInt TinyInt TinyInt 4

Integer data from 0 through 255.

UniqueIdentifier UniqueIdentifier UniqueIdentifier 27

Is a 16-byte GUID

Unknown Unknown Unknown 0

Nothing was defined.

VarBinary VarBinary VarBinary 21

Variable-length binary data with a maximum length of 8,000 bytes.

VarChar VarChar VarChar 15

Variable-length non-Unicode data with a maximum of 8,000 characters.

Variant Variant Variant 24

A data type that stores values of various SQL Server-supported data types, except text, ntext, timestamp, and sql_variant.

Xml Xml Xml 28

xml data type

Applies to