支持的数据类型Supported Data Types

内存优化表和本机编译存储过程中 支持 以下数据类型:The following data types are supported in memory-optimized tables and natively compiled stored procedures:

数值数据类型Numeric Data Types

数据类型Data type 有关详细信息,请参阅:For more information
ssNoversionint int、bigint、smallint 和 tinyint (Transact-SQL)int, bigint, smallint, and tinyint (Transact-SQL)
BIGINTbigint int、bigint、smallint 和 tinyint (Transact-SQL)int, bigint, smallint, and tinyint (Transact-SQL)
SMALLINTsmallint int、bigint、smallint 和 tinyint (Transact-SQL)int, bigint, smallint, and tinyint (Transact-SQL)
TINYINTtinyint int、bigint、smallint 和 tinyint (Transact-SQL)int, bigint, smallint, and tinyint (Transact-SQL)
Decimaldecimal decimal 和 numeric (Transact-SQL)decimal and numeric (Transact-SQL)
NUMERICnumeric decimal 和 numeric (Transact-SQL)decimal and numeric (Transact-SQL)
FLOATfloat float 和 real (Transact-SQL)float and real (Transact-SQL)
REALreal float 和 real (Transact-SQL)float and real (Transact-SQL)
moneymoney money 和 smallmoney (Transact-SQL)money and smallmoney (Transact-SQL)
SMALLMONEYsmallmoney money 和 smallmoney (Transact-SQL)money and smallmoney (Transact-SQL)

字符串数据类型String Data Types

数据类型Data type 有关详细信息,请参阅:For more information
char(n)char(n) char 和 varchar (Transact-SQL)char and varchar (Transact-SQL)
varchar(n) 1varchar(n) 1 char 和 varchar (Transact-SQL)char and varchar (Transact-SQL)
nchar(n)nchar(n) nchar 和 nvarchar (Transact-SQL)nchar and nvarchar (Transact-SQL)
nvarchar(n) 1nvarchar(n) 1 nchar 和 nvarchar (Transact-SQL)nchar and nvarchar (Transact-SQL)
sysnamesysname nchar 和 nvarchar (Transact-SQL)nchar and nvarchar (Transact-SQL)

1限制为每行总数 8060 个字节变量长度类型中的 counting (n)。1 Limitation is 8060 bytes per row total, counting (n) in variable-length types.

有关支持的排序规则的信息,请参阅 Collations and Code PagesFor information about supported collations, see Collations and Code Pages.

日期和时间数据类型Date and Time Data Types

数据类型Data type 有关详细信息,请参阅:For more information
datedate date (Transact-SQL)date (Transact-SQL)
timetime time (Transact-SQL)time (Transact-SQL)
DATETIMEdatetime datetime (Transact-SQL)datetime (Transact-SQL)
datetime2datetime2 datetime2 (Transact-SQL)datetime2 (Transact-SQL)
smalldatetimesmalldatetime smalldatetime (Transact-SQL)smalldatetime (Transact-SQL)

二进制数据类型Binary Data Types

数据类型Data type 有关详细信息,请参阅:For more information
bitbit bit (Transact-SQL)bit (Transact-SQL)
binary(n)binary(n) binary 和 varbinary (Transact-SQL)binary and varbinary (Transact-SQL)
varbinary (n) 1varbinary(n) 1 binary 和 varbinary (Transact-SQL)binary and varbinary (Transact-SQL)

1限制为每行总数 8060 个字节变量长度类型中的 counting (n)。1 Limitation is 8060 bytes per row total, counting (n) in variable-length types.

其他数据类型Other data types

数据类型Data type 有关详细信息,请参阅:For more information
UNIQUEIDENTIFIERuniqueidentifier uniqueidentifier (Transact-SQL)uniqueidentifier (Transact-SQL)

不支持的数据类型Unsupported Data Types

不支持以下数据类型:The following data types are not supported:

DATETIMEOFFSETDATETIMEOFFSET GEOGRAPHYGEOGRAPHY GEOMETRYGEOMETRY
HIERARCHYIDHIERARCHYID 大型对象 (LOB)。Large Objects (LOBs). 例如,varchar(max)、nvarchar(max)、varbinary(max)、image、xml、text 和 ntext。For example, varchar(max), nvarchar(max), varbinary(max), image, xml, text, and ntext. ROWVERSIONROWVERSION
sql_variantsql_variant CLR 函数CLR functions 用户定义类型 (UDT)User-defined types (UDTs)

请参阅See Also

对内存中 OLTP 的 Transact-SQL 支持 Transact-SQL Support for In-Memory OLTP
在内存优化的表中实现 LOB 列 Implementing LOB Columns in a Memory-Optimized Table
在内存优化的表中实现 SQL_VARIANTImplementing SQL_VARIANT in a Memory-Optimized Table