mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Reason: There are pre-looping data initialization and post-looping reintialization in Stored Proc DailyProcssToCreateHistory. If the batch commit is in 6-wwi-data-simulation.sql, there will be duplicated pre-loop initialization, security setting and wrong post-loop data initialization. Solution: Move the batch commit into DailyProcssToCreateHistory's WHILE loop. Known behavior: the day after 20151220 will trigger RecordColdRoomTemperatures, which is slow and it's my next work item.
25 lines
1.5 KiB
Transact-SQL
25 lines
1.5 KiB
Transact-SQL
-- Run data simulation to populate the database.
|
||
-- Runtime: ~15 minutes from 20130101 to 20151219
|
||
|
||
USE WideWorldImporters;
|
||
GO
|
||
|
||
SET NOCOUNT ON;
|
||
|
||
EXEC DataLoadSimulation.Configuration_ApplyDataLoadSimulationProcedures;
|
||
|
||
EXEC DataLoadSimulation.DailyProcessToCreateHistory
|
||
@StartDate = '20130101',
|
||
@EndDate = '20151219', -- the day after 20151220 will trigger RecordColdRoomTemperatures, which is the next work item to tune
|
||
@AverageNumberOfCustomerOrdersPerDay = 60,
|
||
@SaturdayPercentageOfNormalWorkDay = 50,
|
||
@SundayPercentageOfNormalWorkDay = 0,
|
||
@UpdateCustomFields = 1,
|
||
@IsSilentMode = 1,
|
||
@AreDatesPrinted = 1,
|
||
@CommitBatchSize=10;
|
||
|
||
EXEC WideWorldImporters.DataLoadSimulation.Configuration_RemoveDataLoadSimulationProcedures;
|
||
GO
|
||
|