Mast head image

Interpretation Restrictions

This script lists the restriction reasons for an interpretation rating.


Text highlighted in yellow in the example script can be changed for a particular area and interpretation. Examples can be found on the Tips page.

Tips Page

Copy the example script below and paste it into the query page on the Soil Data Access site.

Soil Data Access Query Page

Example Script

SELECT areasymbol, musym, mapunit.mukey, muname, compname, comppct_r, majcompflag, cointerp.mrulename,

cointerp.ruledepth, interphr, interphrc, rulename, component.cokey

INTO #ratings

FROM legend INNER JOIN mapunit ON legend.lkey = mapunit.lkey

INNER JOIN component ON mapunit.mukey = component.mukey

INNER JOIN cointerp ON component.cokey = cointerp.cokey

WHERE legend.areasymbol LIKE 'KS169'

AND ruledepth = 0

AND majcompflag = 'Yes'

AND mrulename LIKE 'DHS - Catastrophic Mortality, Large Animal Disposal, Trench'

AND cointerp.seqnum = 0

ORDER BY areasymbol, mukey, comppct_r DESC, cokey, cointerp.mrulename, ruledepth, interphr DESC, rulename

SELECT areasymbol, musym, mapunit.mukey, mapunit.muname, compname, comppct_r, majcompflag, cointerp.mrulename,

cointerp.ruledepth, interphr, interphrc, rulename, component.cokey

INTO #basement

FROM legend INNER JOIN mapunit ON legend.lkey = mapunit.lkey

INNER JOIN component ON mapunit.mukey = component.mukey

INNER JOIN cointerp ON component.cokey = cointerp.cokey

WHERE legend.areasymbol LIKE 'KS169'

AND interphr <> 0

AND cointerp.seqnum >0

AND mrulename LIKE 'DHS - Catastrophic Mortality, Large Animal Disposal, Trench'

ORDER BY mapunit.mukey, comppct_r DESC, cokey, cointerp.mrulename, ruledepth, interphr DESC, rulename

SELECT DISTINCT mukey, muname, cokey, compname, comppct_r, interphr, SUBSTRING( ( SELECT ( '; ' + interphrc)

FROM #basement t2

WHERE t1.cokey = t2.cokey

ORDER BY t1.cokey, t2.cokey

FOR XML PATH('') ), 3, 1000) AS restrictions

INTO #tempbase FROM #basement t1

GROUP BY mukey, muname, comppct_r, cokey, compname, interphr, interphrc

ORDER BY mukey, muname, comppct_r DESC, cokey, compname, interphr DESC

SELECT areasymbol, musym, r.mukey, r.muname, r.cokey, r.compname, r.comppct_r, majcompflag, mrulename, r.interphr, interphrc, restrictions

INTO #final

FROM #ratings r

LEFT OUTER JOIN #tempbase t ON r.cokey=t.cokey

ORDER BY mukey, muname, comppct_r DESC, cokey, compname

SELECT DISTINCT areasymbol AS Area_symbol, musym AS Map_unit_symbol, mukey AS MUKEY, muname AS Map_unit_name, cokey AS COKEY,

compname AS Component_name, comppct_r AS Component_percentage, majcompflag, mrulename AS Rule_name, CAST(CONVERT(DECIMAL(10,1),interphr) AS nvarchar) AS Rating,

interphrc + ': ' + ISNULL(restrictions, '') AS Interpretation_class

FROM #final

ORDER BY mukey, muname, comppct_r DESC, cokey, compname

DROP TABLE #basement

DROP TABLE #tempbase

DROP TABLE #ratings

DROP TABLE #final

Example Table Output

Description of tables and columns can be found on this link: Table and Column Descriptions

Area_symbol Map_unit_symbol MUKEY Map_unit_name COKEY Component_name Component_percentage majcompflag Rule_name Rating Interpretation_class
KS169 3250 1382154 Bavaria-Detroit complex, rarely flooded 13553004 Bavaria 60 Yes DHS - Catastrophic Mortality, Large Animal Disposal, Trench 1.0 Very limited: Excess sodium; Flooding; Dusty; Unstable excavation walls
KS169 3250 1382154 Bavaria-Detroit complex, rarely flooded 13553002 Detroit 30 Yes DHS - Catastrophic Mortality, Large Animal Disposal, Trench 0.4 Somewhat limited: Flooding; Dusty; Unstable excavation walls
KS169 3755 1382171 Hord silt loam, rarely flooded 13553022 Hord 90 Yes DHS - Catastrophic Mortality, Large Animal Disposal, Trench 0.4 Somewhat limited: Flooding; Dusty; Unstable excavation walls



Helping People Help the Land

USDA is an equal opportunity provider, employer, and lender.