CONTACT US: 778-373-4422 | info@mackenziemackenzie.com


Photo by Anthony Arnaud from Pixabay

How to Show a Part Map in SQL Server Using Recursion

10-September-2021
A very common problem in querying ERP or manufacturing MRP systems is that they use “self-join” tables to store their part information. These tables store “bill of materials” or “BOM” information, where complete assemblies of items can be found. However, it is often not so easy to easily show where a particular part “lives”. Is it 5 levels deep in the tree? 10 levels? What is the parent’s parent? What is the top level part? In this episode I will show you how to query this information using recursion, so that you can see the entire list of parts for a selected child part. Then, we’re going to pivot this hierarchy so that it can be inserted into a table which can then be viewed using tools like Power BI, which can create hierarchies on the fields we created, resulting in visuals with lots of depth and information.



Data Engineering Project? Contact me today!

3 Reasons Why You Should Learn Data Techniques

Find 3 big reasons why you should learn data techniques if you are a professional or business person.

Read article

About our workshop

The Professional Problem, 3 Things They Need, and 1 They Don't Have

Why do people constantly run into problems with their data, even when they are highly trained in their area?

Read article

About our workshop

Why Finding Uniqueness is the Key: 6 Methods to Help

Find out why keys and uniqueness are so important for data transformation and data analysis.

Read article

About our workshop

When to Excel and When Not To: Why Specialists Don't Use Excel for Data Transformations

Start your journey in data transformation, and learn why specialists don't use Excel to transform raw data for analysis.

Read article

About our workshop