DataLoadSimulation.PopulateDataToCurrentDate
Documentation | WideWorldImporters |
Schema | DataLoadSimulation |
Name | PopulateDataToCurrentDate |
Input/Output
Mode | Name | Data type | Description | |
---|---|---|---|---|
1 | IN | AverageNumberOfCustomerOrdersPerDay | int | |
2 | IN | SaturdayPercentageOfNormalWorkDay | int | |
3 | IN | SundayPercentageOfNormalWorkDay | int | |
4 | IN | IsSilentMode | bit | |
5 | IN | AreDatesPrinted | bit |
Script
CREATE PROCEDURE DataLoadSimulation.PopulateDataToCurrentDate @AverageNumberOfCustomerOrdersPerDay int, @SaturdayPercentageOfNormalWorkDay int, @SundayPercentageOfNormalWorkDay int, @IsSilentMode bit, @AreDatesPrinted bit AS BEGIN SET NOCOUNT ON; EXEC DataLoadSimulation.Configuration_ApplyDataLoadSimulationProcedures; DECLARE @CurrentMaximumDate date = COALESCE((SELECT MAX(OrderDate) FROM Sales.Orders), '20121231'); DECLARE @StartingDate date = DATEADD(day, 1, @CurrentMaximumDate); DECLARE @EndingDate date = CAST(DATEADD(day, -1, SYSDATETIME()) AS date); EXEC DataLoadSimulation.DailyProcessToCreateHistory @StartDate = @StartingDate, @EndDate = @EndingDate, @AverageNumberOfCustomerOrdersPerDay = @AverageNumberOfCustomerOrdersPerDay, @SaturdayPercentageOfNormalWorkDay = @SaturdayPercentageOfNormalWorkDay, @SundayPercentageOfNormalWorkDay = @SundayPercentageOfNormalWorkDay, @UpdateCustomFields = 0, -- they were done in the initial load @IsSilentMode = @IsSilentMode, @AreDatesPrinted = @AreDatesPrinted; EXEC DataLoadSimulation.Configuration_RemoveDataLoadSimulationProcedures; END; |
Exported: 2019-02-04 23:04, Last imported: 2018-08-10 09:51