SSIS DailyETL Package Fails with FK Constraint Error

45 Views Asked by At

I recently downloaded clean copies of WideWorldImporters & WideWorldImportersDW from GitHub. I am following the instructions here https://learn.microsoft.com/en-us/sql/samples/wide-world-importers-generate-data?view=sql-server-ver16. I have expanded WWI and reseeded DWH. When I run DailyETL.ispac all is well until EXEC Integration.MigrateStagedMovementData;" failed with the following error: "The MERGE statement conflicted with the FOREIGN KEY constraint "FK_Fact_Movement_Date_Key_Dimension_Date" about line 48. After much Googling around cannot seem to make any progress on finding a way forward. The 'Tech Support' link from within SSMS sends me somewhere pretty useless. Can't believe I'm the first person to have this happen. Can anyone point me in the right direction please?

1

There are 1 best solutions below

0
On

Just in case anyone else is ever interested the 'expand' function cited in the link above generates additional data within WWI OLTP database. The sp EXEC Integration.PopulateDateDimensionForYear @YearNumber;(step 3 within the corresponding Daily.ETL.ispac updates Dimension.Date @ WWI OLAP for current year only. Github sample database is up-to-date as at end 2016, years 2017 through 2021 are missing from Dimension.Date hence FK lookup failure. Manually run sp via SSMS for each year missing in Dim.Date & re-run Daily.ETL.ispac

enter image description here