Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Surrogate Keys Usage

Posted on 2013-11-14
4
297 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

How our DevOps Teams Maximize Uptime

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

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

809 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