dts lab b creating a parallel data load

6
APAC BI Training Lab B: Creating a Parallel Data Load 1 DTS Lab B: Creating a Parallel Data Load In this lab, you load additional product data into product_dim. This new product data exists in an Excel spreadsheet called drinks.xls. You will load the product data into product_dim in parallel with Northwind product data by using the product_dim package. If you have trouble completing the lab, please refer to the answer file at C:\BITechnicalTraining\DTS\ AnswerFiles\Lab B product_dim.dts. Exercise 1 Creating the Transform Data Task In this exercise, you will create a Transform Data Task to load data from Excel into the product_dim dimension. Open up the Lab B starter package 1. Right-click the Data Transformation Services folder and then click Open Package. 2. In the Select File dialog box, type C:\ BITechnicalTraining\DTS\Packages\Lab B.dts in the File name box, and then click Open. 3. In the Select Package dialog box, double-click product_dim. To set up the Product Target Excel connection First create another polaris connection so that the product data loads can proceed in parallel. 1. In the product_dim package, click the Microsoft OLE DB Provider for SQL Server icon in the Connection toolbar. 2. In the New connection box, type Product Target Excel as the connection name. 3. In the Database drop down, select polaris. 4. Click OK. To add a Transform Data Task 1. Click a blank area of the design sheet.

Upload: jbascribd

Post on 11-Jan-2016

214 views

Category:

Documents


2 download

DESCRIPTION

BI Training

TRANSCRIPT

Page 1: DTS Lab B Creating a Parallel Data Load

APAC BI Training

DTS Lab B: Creating a Parallel Data Load 1

DTS Lab B: Creating a Parallel Data Load In this lab, you load additional product data into product_dim. This new product data exists in an Excel spreadsheet called drinks.xls. You will load the product data into product_dim in parallel with Northwind product data by using the product_dim package.

If you have trouble completing the lab, please refer to the answer file at C:\BITechnicalTraining\DTS\AnswerFiles\Lab B product_dim.dts.

Exercise 1

Creating the Transform Data Task In this exercise, you will create a Transform Data Task to load data from Excel into the product_dim dimension.

Open up the Lab B starter package

1. Right-click the Data Transformation Services folder and then click Open Package.

2. In the Select File dialog box, type C:\BITechnicalTraining\DTS\Packages\Lab B.dts in the File name box, and then click Open.

3. In the Select Package dialog box, double-click product_dim.

To set up the Product Target Excel connection

First create another polaris connection so that the product data loads can proceed in parallel.

1. In the product_dim package, click the Microsoft OLE DB Provider for SQL Server icon in the Connection toolbar.

2. In the New connection box, type Product Target Excel as the connection name.

3. In the Database drop down, select polaris.

4. Click OK.

To add a Transform Data Task

1. Click a blank area of the design sheet.

2. Click the Transform Data Task arrow icon in the Task toolbar.

3. Click the Product Source Excel connection as the source connection, and then click the Product Target Excel connection as the destination connection.

Page 2: DTS Lab B Creating a Parallel Data Load

APAC BI Training

DTS Lab B: Creating a Parallel Data Load 2

To configure a Transform Data Task

1. Double-click the Transform Data Task arrow that joins the Product Source Excel and Product Target Excel connections.

2. Click the Source tab and type load Excel data in the Description box.

3. Click Sheet1$ from the Table / View list and then click Preview.

4. Click OK.

5. Click the Destination tab, and then click [polaris].[dbo].[product_dim] from the Table name list.

To copy data from source to a destination

1. Click the Transformations tab, and then click Delete All.

2. Highlight all columns in the Source list.

3. Highlight all columns in the Destination list, except for the product_dim_key, and then click New.

4. In the Create New Transformation dialog box¸ select Copy Column, and then click OK.

5. In the Transformation Options dialog box, type copy product in the Name box.

6. Click Properties to verify the source to destination column order, and then click OK.

7. Click OK to exit out of the Transformation Options dialog box, and then click OK to exit out of the Transform Data Task Properties dialog box.

Exercise 2Defining the Package Workflow

In this exercise, you will define the workflow of the product_dim package as follows:

Old data should be successfully deleted from the product_dim dimension prior to the parallel data loads from the Northwind database and the drinks.xls file.

To define the package workflow

In this procedure, you will create precedence constraints to meet the workflow requirements of the product_dim package.

1. Click the Delete Execute SQL Task, press the CTRL key, and click the Product Source Excel connection.

2. Click the Workflow menu, and then click On Success.

Page 3: DTS Lab B Creating a Parallel Data Load

APAC BI Training

DTS Lab B: Creating a Parallel Data Load 3

Exercise 3Finishing Up and Executing

In this exercise, you will save the product_dim package to SQL Server, execute the package, and then verify the package results.

To save the product_dim package to SQL Server

1. Click the Package menu, and then click Save As.

2. Use the information in the following table to save the DTS package to your local SQL Server. Accept the defaults for any options that are not listed, click OK, and then close DTS Package Designer.

Parameter Value

Package name parallel_data_load

Location SQL Server

To execute the product_dim package in DTS Package Designer

1. Click the Execute play button on DTS Package Designer toolbar, and then click OK in Package Execution Results dialog box.

2. If any step failed, double-click the step’s name to display the error message for the step.

3. Click Done.

To verify package results

1. Click Start, point to Programs, point to Microsoft SQL Server, and then click Query Analyzer.

2. In the Connect to SQL Server dialog box, click OK.

3. Go to the database list in the toolbar, and then click polaris.

4. Type the following query:

SELECT * FROM product_dim

5. Click the Execute Query play button on the toolbar.

6. Review data results. You should have 102 records in the product_dim dimension. Verify one record of data by using the following table.

Column name Value

product_dim_key <Values may vary>

product_id_app 100

product_name Pearl Imported Beer

reorder level 25

obsolete flag F

category_name Drinks

category_description Soft drinks, coffees, teas, beers, and ales

unit_price 32.0000

quantity_per_unit 24 – 12 oz bottles