sqlperformancedatabase-designmaintainability

Generalizing work orders database table design


Hello stackoverflowians,

I am working on designing tables for work orders.

The problem:

What is needed

Constraints

What has been done

Designed all work orders and their details as a hierarchy starting from work order num as the mother node.

WorkOrderTable (ID, ParentID, Type, Value)

example of a work order Transform hierarchical data into flat table

ID  ParentID    Type        Value
38  0           Num         327
39  38          Sector      21
40  38          Sector      22
43  40          Product     NS
44  40          Product     MS
50  40          Temp        RAS
48  44          Quantity    60
47  43          Quantity    25
41  39          Product     ARF
42  39          Product     BRF
49  39          Temp        RAS
51  39          Cible       Acarien A.
46  42          Quantity    30
52  42          Cible       Acarien B.
45  41          Quantity    20

The Question

Is what I am doing good/efficient easy to maintain work with or there is other ideas?

UPDATE I: More details

State of the design

  • Specific tables for participants sectors, people, machines...

  • Meta-data table (ID, meta-data, lvl). Example :

  • Sector, 1 (directly to WO)

  • Tank Storage, 1

  • Product, 2 (can be part of sector job not directly to WO) sd

  • Work Order table (ID, parentID, metadataID, valueID) the value ID is taken from the participants table

Concerning XML I have so to no information about how to store them and manipulate them.


Solution

  • Without knowing any numbers and further knowledge about your needs no good advise is possible. Here are some question coming into my mind

    It looks like trying to re-invent a professional ERP system. As Bostwick told you already, you should rather think about to use an existing one...

    Just some general hints: