In Memory Database Remove File and FileGroup

Currently, the only way to remove Hekaton is to drop the whole database.

Probably not your first choice, but it doesn't look like Microsoft is willing to change course on that.


Microsoft has addressed this in SQL 2019.

Version: Microsoft SQL Server 2019 (CTP3.2) - 15.0.1800.32 (X64) Jul 17 2019 21:29:33

Please check this link.

In case link has gone, the syntax is this:

Filegroup Management – Remove File from filegroup

ALTER DATABASE [database] REMOVE FILE [symbolicName];

Sample:

ALTER DATABASE [MyDatabase] REMOVE FILE [InMemoryContainer]
GO

Filegroup Management – Remove Filegroup

ALTER DATABASE [database] REMOVE FILEGROUP [filegroup];

Sample:

ALTER DATABASE [MyDatabase] REMOVE FILEGROUP [DBMO.MOD];