microsoft / microsoft/sql-server-samples
Data generation fails due to invalid records in ColdRoomTemperatures
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 11.2k
- Forks
- 9.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 14
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DataLoadSimulation.PopulateDataToCurrentDate procedure and the Warehouse.ColdRoomTemperatures_Archive history table described in the report. Reproduce the scheduled call, inspect how invalid period records are generated, and verify that the call completes without requiring manual deletion of rows or resetting temporal tables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100