Вы находитесь на странице: 1из 3

Lab G: Using the Dynamic Properties Task

DTS Lab G: Using the Dynamic Properties


Task
In this lab, you will use the Dynamic Properties task to manage the connections
of the product_dim package.
If you have trouble completing the lab, please refer to the answer file at
C:\BITechnicalTraining\DTS\AnswerFiles\Lab G dynamic_properties.dts

Exercise 1
Modifying the Excel Connection
To open the product_dim package
In this procedure, you will open the product_dim package that has been saved
to SQL Server.
.1 In Enterprise Manager, click Local Packages.
.2 In the right pane, double-click the product_dim package.

To add a Dynamic Properties Task


On the Task toolbar, click the Dynamic Properties Task.

To configure the ProductSourceExcel connection


In this procedure, you will create a global variable to set the Excel file name of
the Product Source Excel connection.
.1 In the Dynamic Properties Task Properties dialog box, type Set
Properties in the Description box.
.2 Click Add.
.3 In the Dynamic Properties Task: Package Properties dialog box, doubleclick Connections, and then click Product Source Excel.
.4 On the right pane, click DataSource, and then click Set.
.5 In the Add/Edit Assignment dialog box, under Source, click Global
Variable.
.6 Click Create Global Variables.
.7 In the Global Variables dialog box, under Name, type SourceFile
.8 Under Value, type C:\BITechnicalTraining\DTS\DataFiles\drinks.xls and
then click OK.
.9 In the Add/Edit Assignment dialog box, in the Variable list, click
SourceFile, click OK, and then click OK to close the Dynamic Properties
Task Properties dialog box.

Lab G: Using the Dynamic Properties Task

Exercise 2
Modifying SQL Servers
Connections
In this exercise, you will use the Set Properties Dynamic Properties Task that
you just created to manage the Product Source NW and Product Target NW
SQL Server connections in the product_dim package.
You will use the COMPUTERNAME environment variable to assign the
computer name to the Product Source NW and Product Target NW
connections.
For SQL Server connections, the computer name is set in the DataSource
property.

To configure the Product Source NW Connection


In this procedure, you will set the DataSource property for the Product Source
NW connection. Use the Set Properties Dynamic Properties Task.
.1 Double-click the Set Properties Dynamic Properties Task.
.2 In the Dynamic Properties Task Properties dialog box, click Add.
.3 In the Dynamic Properties Task: Package Properties dialog box, doubleclick Connections, and then click Product Source NW.
.4 On the right pane, click DataSource and then click Set.
.5 In the Add/Edit Assignment dialog box, under Source, click Environment
Variable.
.6 In the Variable list, click COMPUTERNAME, and then click OK.

To configure the Product Target NW Connection


In this procedure, you will configure the DataSource property of the Product
Target NW connection.
.1 In the Dynamic Properties Task Properties dialog box, click Add.
.2 In the Dynamic Properties Task: Package Properties dialog box, doubleclick Connections, and then click Product Target NW.
.3 On the right pane, click DataSource and then click Set.
.4 In the Add/Edit Assignment dialog box, under Source, click Environment
Variable.
.5 In the Variable list, click COMPUTERNAME, click OK, and then click
OK to close the Dynamic Properties Task Properties dialog box.

Exercise 3
Finishing Up
In this exercise, you will create the package workflow, and then save and
execute the package. Save the package to SQL Server as product_dynamic.
Design the workflow so the Set Properties Dynamic Properties Task executes
prior to all other steps.

Lab G: Using the Dynamic Properties Task

To create the package workflow


In this exercise, you will create the package workflow so that the Set
Properties Dynamic Properties Task executes prior to the Delete Execute SQL
Task.
.1 Click the Set Properties Dynamic Properties Task, press the CTRL key,
and then click Delete Execute SQL Task.
.2 Click the Workflow menu and then click On Success.

To save and execute the package


.1 Save the package to SQL Server.
.2 Execute the package in DTS Package Designer.

Вам также может понравиться