June 22, 2009, 04:32 PM
jgoldenMultiple "Logical Key" fields
Hi all,
we are in the learning process here and i am working on Slowly Changing Dimensions. The question i have is; can you have more than one designated "Logical Key" field in a table? We are loading targets to a MySQL db using some of our previously existing db tables as the intial source, and carrying over exisitng columns, including exisitng Surrogate key fields for historical purposes. However, as the ongoing flow process, we are loading these dimension tables as SCD; but some of these tables do not have one unique identifier per unit. Instead, they are unique when a combination of fields are considered - this is where i was looking to make them Logical Key fields. Do i have to create a Unique ID based on these fields to then use?
thanks
Jamie
June 24, 2009, 05:32 AM
thenmozhihi,
we can have two column as logical key field for the target table...
target table can have one surrogative key field...
the two logical key field can be set as keys also..
its working fine..
thanks.
thenmozhi
June 24, 2009, 11:00 AM
jgoldenthanks for the response - we are trying to set multiple fields (4) as logical keys; but i don't know if this is acceptable and can not find any documentation - the combination of these fields should make a record unique - also,how could a logical key field be set as a surrogate key when the SCD type for surrogate has to be blank?
June 26, 2009, 03:43 AM
thenmozhihi,
a blank value of scd type identifies permanent column, that one does not updated, if its the key column, then its is treated as surrogative key, and each inserted row automatically gets a new value increment plus one for each row.
for the field with balnk vlaue no need for any mapping.. its increment automatic..
the logical key field is the key or keys that uniquely identify a row..
so any number of logical key field can be set and that can set as keys also that uniquely identify the row..
its working fine..
thanks,
thenmozhi.