1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00
Files
sql-server-samples/samples/databases/wide-world-importers/wwi-database-scripts/6-wwi-data-simulation.sql
ShiyangQiu a58056f6fd Resubmit: Moving the batch commit to Stored Proc DailyProcssToCreateHistory
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.
2016-07-15 11:27:45 +08:00

25 lines
1.5 KiB
Transact-SQL
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 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