Added a memory table FileGroup for dbtest, but error occurred while creating memory Optimized table
Cannot create memory optimized tables in a database The does not has an online and non-empty Memory_optimized_data Fileg Roup.
Use [Master]GOALTER DATABASE [DBTest] ADDFILEGROUP[Memorytablegroup] CONTAINSMemory_optimized_data;GO Use [DBTest]GO--Drop table if it already exists.IF object_id('dbo. Memorytable_test','U') is not NULL DROP TABLEdbo. Memorytable_testGOCREATE TABLEdbo. Memorytable_test (IDint not NULL, namevarchar( One) not NULL, Ageint not NULL, constraintpk__memorytable_testPrimary Key nonclusteredHash (ID) with(Bucket_count=1024x768)) with(memory_optimized= on, durability=schema_and_data)GO
To view Memorytablegroup, whose number of FileStream files is 0, you need to add file for the filegroup.
Add a file,memory table for Memorytablegroup to create the success.
ALTER DATABASE [DBTest] ADD FILE (Name='dbtest_file1', filename='d:\ Mssqlserverdata\mssql12. Mssqlserver\mssql\data\dbtest_file1'to[Memorytablegroup ]GO
Reference doc:
The Memory Optimized Filegroup
Cannot create memory optimized tables in a database on SQL Server 2014
Cannot create memory Optimized Table