自MSSQL2014开始引入内存表。
怎样创建内存表:
USE test
GO
ALTER DATABASE test
ADD FILEGROUP fg_test CONTAINS MEMORY_OPTIMIZED_DATA
ALTER DATABASE test
ADD FILE
( NAME = 'TestMemoryDBDirectory',
FILENAME = 'd:memdata')
TO FILEGROUP fg_test
go
CREATE TABLE Products
(
ProductID varchar(6) primary key nonclustered,
ProductName varchar(64) not NULL,
Price decimal(10,2) not NULL,
Unit varchar(16) not null,
Description varchar(100) NULL
)
with(MEMORY_OPTIMIZED=ON,DURABILITY= SCHEMA_AND_DATA)
GO