SELECT Top [Hfmbdata].query (' (/items/item[@ID = ' tbbryj ') '). Value (' (//textvalue) [1] ', ' nvarchar (max) ') as MZ,
[Hfmbdata].value (' (items/item[@ID = "rb_fzhd_y"]/@ControlType) [1] ', ' varchar ') from [EMRCP]. [dbo]. [T_ZYBR_HF] as at
Get results:
MZ at
No Checkbox.radiobox
Sample XML (Hfmbdata)
<Items>
<item id= "Rb_cyhhjzk_h" name= "Cyhhjzk" controltype= "Checkbox.radiobox" value= "" checked= "True" >
<TextValue> Good </TextValue>
</Item>
<item id= "Rb_cyhhjzk_yb" name= "Cyhhjzk" controltype= "Checkbox.radiobox" value= "" checked= "False" >
<TextValue> General </TextValue>
</Item>
<item id= "Rb_cyhhjzk_bh" name= "Cyhhjzk" controltype= "Checkbox.radiobox" value= "" checked= "False" >
<TextValue> Bad </TextValue>
</Item>
<item id= "Rb_sy_h" name= "sy" controltype= "Checkbox.radiobox" value= "" checked= "True" >
<TextValue> Good </TextValue>
</Item>
<item id= "Rb_sy_yb" name= "sy" controltype= "Checkbox.radiobox" value= "" checked= "False" >
<TextValue> General </TextValue>
</Item>
<item id= "RB_SY_BH" name= "sy" controltype= "Checkbox.radiobox" value= "" checked= "False" >
<TextValue> Bad </TextValue>
</Item>
<item id= "rb_asfy_y" name= "asfy" controltype= "Checkbox.radiobox" value= "" checked= "False" >
<TextValue> has </TextValue>
</Item>
<item id= "rb_asfy_my" name= "asfy" controltype= "Checkbox.radiobox" value= "" checked= "False" >
<TextValue> No </TextValue>
</Item>
<item id= "rb_cxzz_y" name= "Cxzz" controltype= "Checkbox.radiobox" value= "" checked= "False" >
<TextValue> has </TextValue>
</Item>
<item id= "rb_cxzz_my" name= "Cxzz" controltype= "Checkbox.radiobox" value= "" checked= "False" >
<TextValue> No </TextValue>
</Item>
<item id= "Tbbryj" name= "" controltype= "Inputfield.text" value= "" >
<TextValue> No </TextValue>
<items/>
</Item>
<item id= "Tb_hfryyj" name= "" controltype= "Inputfield.text" value= "" >
<TextValue> No </TextValue>
<items/>
</Item>
<item id= "Tb_yshfyj" name= "" controltype= "Inputfield.text" value= "" >
<TextValue> No </TextValue>
<items/>
</Item>
</Items>
SQL XML Query specifies node values, and node property values