Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8337401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:17:42+00:00 2026-06-09T04:17:42+00:00

In the source table, there are two columns as following snapshot shows: Then for

  • 0

In the source table, there are two columns as following snapshot shows:

enter image description here

Then for destination table, it should be something like this:

enter image description here

(“DimLocationKey” is auto-generated surrogate key)

How could I achieve self-referencing effect in SSIS? I tried following approach but it’s not working because there would be no matches in the lookup.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:17:44+00:00Added an answer on June 9, 2026 at 4:17 am

    If the column is nullable, then you could load the unique values for location_ID and then have a secondary process come back through and take care of updating existing and possibly adding new.

    Pass 1

    1 NULL A NULL
    2 NULL B NULL 
    3 NULL C NULL
    4 NULL D NULL
    

    I suppose if it’s not nullable, then you could precompute those ids in a data flow and assign current row and parent to themselves. As a developer, I might hate you for that though 😉

    Pass 2

    At this point, it becomes a question of whether there should be 8 rows in the table or 4 (whatever your source data indicates). This becomes a question for business users, appropriately “dumbed down”. I’ve seen both answers in my hierarchy questions – “Who does the President report to?” At one place, the President reported to no one which meant expense requests were automatically approved. A different place had the CEO report to themselves which meant their expense reports still had to be approved by themselves. I guess it was to ensure they had executive accountability as nothing was automagic.

    If the answer is 8 rows, then your data flow would look about right. If it’s 4, then you’d use the existing data flow but update the rows instead. If it’s a small set of rows, hundreds, then you can use the OLEDB Command and write your update statement. Just realize that it will issue an UPDATE statement for every row that hits the component. That can bring your processing to a standstill as it’s terribly inefficient.

    The more efficient route for updates is to use the OLE DB destination and the after the Data Flow completed, have an Execute SQL task issue a set-based UPDATE statement. See Andy Leonard’s Stairway to Integration Services series for a well written example of how to do this.

    If it’s not nullable and nodes referencing themselves is not allowed, then it seems your data model does not accurately describe

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two columns, source and destination in table Hyperlink, to store the source
My source table looks like this Id StartDate 1 (null) 2 12/12/2009 3 10/10/2009
Very simplified, I have two tables Source and Target. declare @Source table (SourceID int
I'm doing a left join on two tables. Table one shows potential users while
I need to insert into a simple table with two columns. The first column
Is there an easy way to update the data source for multiple pivot tables
OLEDB source table Name,Age,Seq Gauraw,30,1 Gauraw,31,1 Kiran,28,3 Kiran,29,3 kiran,28,3 Venkatesh,,4 Venkatesh,28,4 I want OLEDB
Here is the source Table . I want to retrieve the Name , Host
I'm trying to find the best way to load a source table from MySQL
Using a SELECT statement in MS SQL 2005 TSQL, and no source table, just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.