Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Surrogate Keys Usage

Posted on 2013-11-14
4
Medium Priority
?
307 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 2000 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

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

773 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