Uncompress File Task


Uncompress File Task extracts the contents of a given input compressed file into a specified folder.



The compressed file that will be used in this Tutorial is shown in Figure 1.

sample compressed file

Figure 1

Configuring Uncompress File Task

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

  1. Drag-and-drop the Uncompress File Task into the Control Flow, or
  2. Double clicking theĀ Uncompress File Task
Uncompress File Task - Toolbox

Figure 2

By default the Uncompress File Task will throw validation errors shown in Figure 3.

Uncompress File Task - Validation Errors

Figure 3

To resolve the validation errors, we need to configure the Uncompress File Task by using its editor (Uncompress File Task Editor).

Uncompress File Task Editor

There are two ways of configuring the textbox values in the editor:

Set Absolute Values

Providing absolute values for the two parameters refers to hardcoding the values into the two textboxes typing them in or by clicking the ellipsis buttons (…) to browse for required files/folders, as shown in Figures 5.

Uncompress File Task - Set Values

Figure 5

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.

Uncompress File Task - Dynamic Values

Once you have clicked the OK button, you will be redirected back to the Uncompress File Task Editor with textboxes set to variable names.

Uncompress File Task - Expressions

Executing Uncompress File Task

The execution of the Uncompress File Task is usually quick. Similarly to executing other SSIS tasks, the simplest way of executing Uncompress File Task is to right-click your mouse button, navigate to and click Execute Task option as shown in Figure 8.

Uncompress File Task - Execute Task

Figure 8

If the configuration is done correctly, the Uncompress File Task execution should be successful as shown in Figure 9.

Uncompress File Task - Successful Execution

Figure 9

Additional information

Additional Informational Events

As the Uncompress File Task is being executed, it is important to take notes of two additional information events that will appear in the Execution Results tab in the designer. As indicated in Figure 10, these two informational events basically describe the parameter values 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.

Uncompress File Task - Execution Results

Figure 10

Existing File Error

The execution of Uncompress File Task will fail when the file being uncompressed already exists in target location.

Uncompress File Task - Already Exist