Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
SQL Server 2017 Developer???s Guide

You're reading from  SQL Server 2017 Developer???s Guide

Product type Book
Published in Mar 2018
Publisher Packt
ISBN-13 9781788476195
Pages 816 pages
Edition 1st Edition
Languages

Table of Contents (25) Chapters

Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
1. Introduction to SQL Server 2017 2. Review of SQL Server Features for Developers 3. SQL Server Tools 4. Transact-SQL and Database Engine Enhancements 5. JSON Support in SQL Server 6. Stretch Database 7. Temporal Tables 8. Tightening Security 9. Query Store 10. Columnstore Indexes 11. Introducing SQL Server In-Memory OLTP 12. In-Memory OLTP Improvements in SQL Server 2017 13. Supporting R in SQL Server 14. Data Exploration and Predictive Modeling with R 15. Introducing Python 16. Graph Database 17. Containers and SQL on Linux 1. Other Books You May Enjoy Index

Creating memory-optimized tables and indexes


Now that we have looked at the theory behind the storage of memory-optimized tables, we want to get to the real fun and create some of these objects.

Laying the foundation

Before we can start creating our memory-optimized objects, we need to create a database with a FILEGROUP designed for memory-optimized objects. This can be achieved as follows:

CREATE DATABASE InMemoryTest 
    ON  
    PRIMARY(NAME = [InMemoryTest_disk],  
               FILENAME = 'C:tempInMemoryTest_disk.mdf', size=100MB),  
    FILEGROUP [InMemoryTest_inmem] CONTAINS MEMORY_OPTIMIZED_DATA 
               (NAME = [InMemoryTest_inmem],  
               FILENAME = 'C:tempInMemoryTest_inmem') 
   LOG ON (name = [InMemoryTest_log], Filename='c:tempInMemoryTest_log.ldf', size=100MB) 
   COLLATE Latin1_General_100_BIN2;  

The first main thing to note is that we have a separate FILEGROUP dedicated to the memory-optimized objects, with the keyword CONTAINS MEMORY_OPTIMIZED_DATA. This...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}