dbTalk Databases Forums  

How to make 'Composite' member key column ?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss How to make 'Composite' member key column ? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tristant
 
Posts: n/a

Default How to make 'Composite' member key column ? - 06-10-2004 , 10:44 PM






Hi All,
I have a dimension table, below :
CREATE TABLE dbo."Product_Dim"(
"ProductID" INT NOT NULL IDENTITY(1,1),
"PRODCODE" CHAR(6) NOT NULL,
"DeptCode" CHAR(2) NOT NULL,
"ProdName" VARCHAR(40) NOT NULL
.............)

Product_Dim can be 3000-5000 rows
ProductID is the Surrrogate key, ProductCode+DeptCode is the operational
key. Each department could have same code.
In the product dimension I have to use 'ProductCode+DeptCode' as 'Member Key
Column'
Fact table is joined into Product_Dim on productID.

What is the best way to create this 'composite member key column', create
New column in product_Dim ?
OR, using View as Product Dim ?

Thank you for your help,
Trist




Reply With Quote
  #2  
Old   
Jonathan Levine
 
Posts: n/a

Default RE: How to make 'Composite' member key column ? - 06-18-2004 , 03:31 AM






"tristant" wrote:

Quote:
Hi All,
I have a dimension table, below :
CREATE TABLE dbo."Product_Dim"(
"ProductID" INT NOT NULL IDENTITY(1,1),
"PRODCODE" CHAR(6) NOT NULL,
"DeptCode" CHAR(2) NOT NULL,
"ProdName" VARCHAR(40) NOT NULL
.............)

Product_Dim can be 3000-5000 rows
ProductID is the Surrrogate key, ProductCode+DeptCode is the operational
key. Each department could have same code.
In the product dimension I have to use 'ProductCode+DeptCode' as 'Member Key
Column'
Fact table is joined into Product_Dim on productID.

What is the best way to create this 'composite member key column', create
New column in product_Dim ?
OR, using View as Product Dim ?

Creating a calculated column will let you index the key column. Or you could create an indexed view. Either should be pretty much the same.

Regards,

Jonathan


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.