87
2.4 Creating Stage Tables
Two separate stage tables need to be created for load_budget and load_forecast. This is the
same as the procedure from the first tutorial for Defining the Staging Table (see "1.10 Defining
the Staging Table" on page 45).
1 Double-click the stage table object group in the left pane. This will list the existing stage
table in the middle pane.
2 Browse to the data warehouse Browse/Source Tables or click on the orange glasses in the
toolbar.
3 Drag the table load_budget from the right pane to the middle pane and drop.
4 Click ADD to add the stage table called stage_budget.
5 Click OK on the Properties dialog.
6 Now bring in the following keys from the right pane into the new table. Click the stage table
name in the left pane to list the stage table columns in the middle pane; this also makes the
middle pane a drop target for new columns:
- dim_customer_key
- dim_product_key
- dim_date_key
7 Now in the left pane, right-click on stage_budget and select Create (ReCreate).
8 In the left pane, right-click on stage_budget and select Properties. In the Update Procedure
field select (Build Procedure...). Click OK.
9 Select Cursor as the update procedure type.
10 Click OK on the Parameters dialog.
11 SQL Server data warehouse users will now see an additional join screen. This screen is
presented even though no joins are required. This screen allows the selection of either a
'Where' based join or an ANSI standard join. The default will be ANSI standard join. Click OK
to proceed.
12 Select the dimension keys:
dim_customer - customer code
dim_product - product code
dim_date - budget/forecast date (depending on which stage table you are working on).
Click > then OK for each one.
13 Now define the business keys. Add customer_code, product_code, and
budget/forecast_date to the business key list, and click OK.
14 Right-click on the stage table in the left pane, and select Execute Update Procedure.
15 Repeat steps (1) to (14) to create stage table stage_forecast from load_forecast.
16 Refresh the Data Warehouse in the right pane (F5).