How to query for Xml values and attributes from table in SQL Server -


I have the XML code below, I need to get "processinignin -> ID, how can I get it Am I

  "& lt;? Xml version =" 1.0 "encoding =" UTF-8 "& gt ;? & lt; processEngine id =" 5,077,000 "InstanceName =" BG2-dev.excers " & Gt; & lt; Controller Heartbeat = "2014-10-27T15: 59: 50" /> 
Loader Heartbeat = "2014-10-27T16: 01: 00" queueLength = "62" /> Waiting list row = "0" /> gt; PreconditionPipline Manager Load = "1.463905239430332E-6" No Offipiliin = "5" Quillimb = "0" Recent Load = "1.1947981003500136 E-5" & gt; & lt; Pipeline Heartbeat = "2014-10-27T16: 0: 01 "index =" 4 "load =" 7.216747673537921E-6 "name =" pre-position pipeline 0 "recentLoad =" 5.963712649181781E -5 "runtime =" 6811 "current =" incorrect "start time =" 2014- 10-16 T17: 59: 18 "/ & gt; & lt; / processEngine & gt;"

Thank you in advance .......

try it -

  DECLARE @ temp1 XML selections @ temp1 = '& lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; ProcessEngine id = "5077000" InstanceName = "BG2-dev.excers" & gt; & Lt; Controller heart beat = "2014-10-27T15: 59: 50" /> & Lt; Loader heart beat = "2014-10-27T16: 01: 00" queueLength = "62" /> & Lt; ConditionWaitList queueLength = "52" /> & Lt; RetryWaitList queueLength = "0" /> & Lt; ActionWaitList queueLength = "0" /> & Lt; Pipeline heart beating = "2014- 10-27T16: 01: 01" index = "4" load = "7.216747673537921E-6" name = "pre-condition pipeline 0" recentLoad = "5.963712649181781E -5" order = "6811 "Running =" false "STARTTIME =" 2014-10-16 T 17: 59: 18 "/> & lt; / Processing Engine & gt; Price @ temp1.nodes ('/ processEngine') a 'SELECT a.b.value (' @ id ',' varchar (10) '), a (b)  

Comments