Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
SET @ResponseReceivedData = '<req:input service="IBSServiceCoordinator" targetnamespace="http://service.app.ibs.fic.com" operation="getExecutedDedupeResults" xmlns:req="http://request.deduperesults.xsd.ibs.com">
    <context bankcode="999">
        <con:supervisorcontext userid="" primarypassword="" xmlns:con="http://context.xsd.ibs.com">
        </con:supervisorcontext>
    </context>
    <custdeduperesultsreqdto apprefno="81980000015582" codserialno="1" namereferencecat=" OmniRefCatID=">
    </custdeduperesultsreqdto>
</req:input>'

Is it possible to read this xml file from sql server ? If yes how ?

What I have tried:

SQL
;with xmlnamespaces(DEFAULT 'http://service.abc.com' )
		SELECT List.y.value('(@CodSerialNo)[1]','VarChar(25)') as CodSerial
		FROM @ResponseReceivedData.nodes('(/input/CustResultsReqDTO)') AS List(y)
Posted
Updated 5-Aug-16 4:54am
v7
Comments
Suvendu Shekhar Giri 5-Aug-16 4:14am    
then what it returned in the result?
Member 12670240 5-Aug-16 4:21am    
Blank
Member 12670240 5-Aug-16 4:22am    
it should return 1
Richard Deeming 5-Aug-16 9:52am    
I've tried to fix your XML - you need to wrap the code in <pre>...</pre> tags, and encode the "special" characters. (<&lt;; >&gt;)

However, something has been lost. Your XML fragment is invalid.

Please update your question with the correct XML.
Member 12670240 5-Aug-16 10:51am    
SET @ResponseReceivedData = '<req:input service="IBSServiceCoordinator"
="" targetnamespace="http://service.app.ibs.fic.com" operation="getExecutedDedupeResults" xmlns:req="http://request.deduperesults.xsd.ibs.com">
<context bankcode="999">
<con:supervisorcontext userid="" primarypassword="" xmlns:con="http://context.xsd.ibs.com">

<custdeduperesultsreqdto apprefno="81980000015582" codserialno="1" namereferencecat=" OmniRefCatID=">
'

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900