Database Reference
In-Depth Information
We will need a memory-optimized filegroup to make use of memory-optimized
tables. To demonstrate In-Memory Optimized tables, we will create a new database
on our SQL Server 2014 instance that will use memory-optimized tables. When
creating the database, you need to create a memory-optimized filegroup. The
T-SQL command will create a database called InMemTab with a memory-optimized
filegroup as given in the following code:
CREATE DATABASE InMemTabs
ON
PRIMARY(NAME = [InMemTabs_data],
FILENAME = 'c:\data\InMemTabs_mod1.mdf', size=500MB)
, FILEGROUP [InMemTabs_mod] CONTAINS MEMORY_OPTIMIZED_DATA( -- name of
the memory-optimized filegroup
NAME = [InMemTabs_dir],
FILENAME = 'c:\data\InMemTabs_dir')
, (NAME = [InMemTabs_dir2],
FILENAME = 'c:\data\InMemTabs_dir2')
LOG ON (name = [InMemTabs_log], Filename='C:\DATA\InMemTabs_log.ldf',
size=500MB)
GO
If you want to run this code, note that it uses the single file location c:\data . This has
to exist if you want to run this script. Also, note that you have to separate out your
data logs and location of the checkpoint files used in the memory-optimized tables in
a production environment depending on how your storage is set up and configured.
When converting tables in the existing database, you have to create the
memory-optimized filegroup using the ALTER database statement.
The Management Studio's database creation wizard has been modified to allow us to
easily create a database with this new feature. When creating a database or working
with database properties, you will see a new section on the filegroup page as shown
in the following screenshot:
 
Search WWH ::




Custom Search