microsoft / sql-server-samples

Azure Data SQL Samples - Official Microsoft GitHub Repository containing code samples for SQL Server, Azure SQL, Azure Synapse, and Azure SQL Edge
Other
9.73k stars 8.78k forks source link

Data generation fails due to invalid records in ColdRoomTemperatures #1275

Open Akaitatsu opened 2 months ago

Akaitatsu commented 2 months ago

I have schedule the data generator to run daily so I can have good demo data for our developers. It occasionally fails with the following error message which requires me to manually delete the invalid rows and reset all the temporal tables.

[SQLSTATE 01000] (Message 0) Setting SYSTEM_VERSIONING to ON failed because history table 'WideWorldImporters.Warehouse.ColdRoomTemperatures_Archive' contains invalid records with end of period set before start.

Here is the stored procedure call that I am using:

EXECUTE DataLoadSimulation.PopulateDataToCurrentDate @AverageNumberOfCustomerOrdersPerDay = 60,
                                                     @SaturdayPercentageOfNormalWorkDay = 50,
                                                     @SundayPercentageOfNormalWorkDay = 0,
                                                     @IsSilentMode = 1,
                                                     @AreDatesPrinted = 1;

I'll dig into the generation code and see if I can fix it since no one appears to be maintaining this project.

abhishekup5338 commented 1 month ago

Hi @Akaitatsu assign this issue to me #1275.