Solved

Surrogate Keys Usage

Posted on 2013-11-14
4
293 Views
Last Modified: 2013-11-22
Hi,

I am new to Datawarehouses.

I have a pre existing dimension table that I have to link to to get the Surrogate Key.  My problem is that the table contains 70 rows, I only need 4 of them.  I do not have an existing business Key to join to the Dim table so I need to join on a varchar column halfway across the dimension table.  For info - If I did a distinct on the column I need to join to it would return 6 values (4 I need and 2 I don't).  

I can do the join but I am concerned on what surrogate keys will be returned.  I only want 1 surrogate for each of the 4 codes but there are multiple surrogate for the same code that I pass in.  What should I do?

Thanks

nutnut
0
Comment
Question by:nutnut
  • 2
  • 2
4 Comments
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39650521
Sounds like you've got a design issue: "but there are multiple surrogate for the same code".

That's something we can't help you with, it all depends on your business rules.  First you need to figure out which record you want or need to match to your code.  Once you know that, you've practically solved the problem because you can then filter them out to get to a match set of only 4 records, each with a unique "code" lookup field to match on.
0
 

Author Comment

by:nutnut
ID: 39656047
Sounds like I need a new dim with only 4 rows then
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 39656331
Well indeed, that would be the ideal solution :)
0
 

Author Closing Comment

by:nutnut
ID: 39668381
Thanks for help
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Query needed to find duplicate entries and remove entry 16 42
Query Syntax 17 32
SQL - Copy data from one database to another 6 19
T-SQL:  Collapsing 9 22
Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
How to increase the row limit in Jasper Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question