mssql内存表

自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

posted @ 2016-11-15 15:24  delphi中间件  阅读(879)  评论(0编辑  收藏  举报