sql server - How to extract an element from an XML file? -
i have following simple xml fragment shown below. t-sql if wanted extract 'entityfriendlyname' attribute?
<simplerulevalue xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <entityid>0</entityid> <entityfriendlyname>aline</entityfriendlyname> </simplerulevalue>
it this:
select cast(x.somexml xml).value('(simplerulevalue/entityfriendlyname)[1]','nvarchar(1000)') entityfriendlyname xmlsource x
Comments
Post a Comment