title: BAAN - MS SQL table query - Bill Of Material explosion
body: <p>Hello we are archiving our legacy BAAN IV system in an Archiving Agnostic Platform.
  I need to produce a BillOfMaterial explosion MS SQL query using standard BAAN Table.
  Giving as input main Material my goal is to obtain all Sub-Material with associated quantity and Cost.
  I'm not BAAN expert but I guess I should use  tiitm001(item master) + tibom010(BOM) +  ticst(Cost) + tirou(Routing) tables.</p>
  
  <p>Example:
  from given Master Item "123-456" reiterate the query until a Sub Item (child node) won't have a SubItem Populated:</p>
  
  <p><a href="https://i.stack.imgur.com/5v9w8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5v9w8.png" alt="enter image description here"></a></p>
  
  <p>I need to produce an extract.</p>
  
  <p>Just wondering if there's some MS SQL query example or some comments as this topic may be already been treated.</p>
  
  <p>Thanks a lot</p>