FIX: "ADD PERIOD FOR SYSTEM_TIME failed" error when you add period columns to a memory-optimized table in SQL Server 2016

Symptoms

Assume that you use In-Memory OLTP in Microsoft SQL Server 2016. In this scenario, you use ALTER TABLE and ADD PERIOD FOR SYSTEM_TIME statements to add period columns that have appropriate default values together with corresponding system-time period to a memory-optimized table. If the table is not empty, you receive an error message that resembles the following:

Msg 13575, Level 16, State 0ADD PERIOD FOR SYSTEM_TIME failed because table 'temporaltest.dbo.DrugMultiComponent' contains records where end of period is not equal to MAX date time.