---
title: "Handling Multiple Priority Values in DH Survey Tables"
canonical: "https://servicedesk.maxgeo.com/space/DS/1645019178/Handling%20Multiple%20Priority%20Values%20in%20DH%20Survey%20Tables"
format: markdown
---
The Desurvey stored procedure cannot handle cases where the DH Survey table contains multiple readings at the same depth with different priority values. If you select the tblDHSurv table as the survey table in such a database, the desurvey process will fail (MDS466 or MDS5).

**Solution:**

To address this issue in databases with multiple priority values, use the standard view tblVWDHSurv_Priority. This view:

- Selects only the best priority records for a given Hole_ID
- Includes the Desurvey columns (X, Y, Z, and Grid_ID) in the package configuration instead of the survey table.

**Registration Issue:**

However, this view is not typically registered and assigned to a module in many databases, preventing the Desurvey process from seeing it during package setup.

For clients with multiple DH Survey priorities, this view should be registered and used in the Desurvey packages.

**Setting Priorities:**

- The best priority value to be used in a database is defined in tblSYSParam and is defaulted to 0 but can be changed by the user
- Priorities for surveys are calculated by the Priority assigned in tblLIBDHSurveyMethod.
- Surveys imported with different methods can have more than one for any hole at any depth (assuming hole/depth match), with the higher priority method assigned P0.
- If depths differ, all will be Priority 0 irrespective of method.

**Loading Data:**

- To load data for the same hole/depth/Survey_Method without overwriting existing data for Priority 0, load the new data with Priority -1. This will auto-shift the original Priority 0 to 1, and the new one will become 0 (if the method is the highest priority).
- If methods differ, both sets of records are kept at differing priorities. If loading the same surveys with the same method, they are prioritized by Load_Date where the last one in will be assigned P0 (PK: DataSet, Hole_ID, Depth, Survey_Method, Priority).
- To retain previous records at the same depths and method, manually update the Priority before loading new results.

**Relogging Data:**

For relogging data, if original logging needs to be retained, manually set older logging to P1 before importing new logging, which will come in as P0.