Database Reference
In-Depth Information
Defining entity relationships in DSV
While creating a data source view, you noticed that SSDT automatically detected
primary and foreign keys between DimDate and fact tables and established their
respective relationships. If our data source does not have referential integrity con-
straints, we would have to define the logical primary keys and necessary relationships
directly within the DSV.
To set up relationships between two objects within a DSV, dimension objects (tables
or views) must have a primary key column and fact tables must reference this column.
The column names in fact and dimension tables do not need to match, but they must
have compatible data types. For example, you cannot create a relationship between
an integer and string columns.
How to do it...
Let's get started; the following are the steps to define the entity relation in DSV:
1. To define a logical primary key on an object that does not already have one,
right-click on the column that uniquely identifies each record in the table and
select Set Logical Primary Key . To check how relationships are defined in
the DSV you created, double-click on the line connecting FactFinance to
DimDate . As shown in the following screenshot, the relationship includes the
table names of both primary and foreign keys:
Search WWH ::




Custom Search