Time Delay Task

Description

Time Delay Task suspends the current thread for given amount of time (measured in Seconds).

Tutorial

The Time Delay Task only has a single input parameter – which is the amount of time that the thread should be suspended for. This value is measured in Seconds and is by default set to 1.

Configuring Time Delay Task

Similarly to adding other SQL Server Integration Services (SSIS) tasks, the Time Delay Task shown in Figure 1 can be added into the Control Flow pane in the following manner;

  1. Drag-and-drop the Time Delay Task into the Control Flow, or
  2. Double clicking the Time Delay Task
Time Delay Task SSIS Toolbox

Figure 1

By default the Time Delay Task will throw validation errors shown in Figure 2.

Time Delay Task - Validation Error

Figure 2

To resolve the validation errors, we need to configure the Time Delay Task by using its editor (Time Delay Task Editor) shown in Figure 3.

Time Delay Task Editor

Figure 3

We can set values of Number of Seconds in two ways:

Set Absolute Values

Either you can use the default value of 1 or type in another numerical value, as shown in Figures 4.

Time Delay Task - Set Value

Figure 4

Dynamically Set Values using Expressions

Expressions reads data from package variables at runtime. To configure expressions, click the Ex button. This will open up a Choose Variable dialog box. You can then select the variable you want to use and click the OK button.

Note: Only variables defined as numeric (i.e. Int32, Int64 etc.) will be retrieved and available and for selection.

Time Delay Task - Variable Configuration

Figure 5

Once you have clicked the OK button, you will be redirected back to the Time Delay Task Editor with Number of Seconds textbox set to the selected variable name as shown in Figure 6.

Time Delay Task - Variable Expression

Figure 6

Executing Time Delay Task

Similarly to executing other SSIS tasks, the simplest way of executing Time Delay Task is to right-click your mouse button, navigate to and click Execute Task option as shown in Figure 7.

Time Delay Task - Execute Task

Figure 7

If the configuration is done correctly, the Time Delay Task execution should be successful as shown in Figure 8.

Time Delay Task

Figure 8

Additional information

Additional Informational Events

As the Time Delay Task is being executed, it is important to take note of an information event that will appear in the Execution Results tab in the designer. As indicated in Figure 9, this informational event basically describe the parameter value that are being used in during task execution. This information could be useful during troubleshooting, especially in cases where Expressions are used to set parameter values.

Time Delay Task - Execution Results

Figure 9