By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,856 Members | 2,163 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,856 IT Pros & Developers. It's quick & easy.

How to query untyped xml data

P: 5
I have a varchar/text field that contains untyped xml. I don't want to use schema. How would one query this:

Expand|Select|Wrap|Line Numbers
  1. <configuration>
  2.   <connectionsettings>
  3.     <add key="appKey" value="355" />
  4.     <add key="SessionURL" value="http://xxxxxx" />
  5.     <add key="UpdateOrderURL" value="http://yyyyyyy" />
  6.     <add key="IgnoreFailure" value="true" />
  7.   </connectionsettings>
  8. </configuration>
I want the "value" for 'IgnoreFailure'

DECLARE @x XML
select @x = myColumn from myTable where recordid = 1
select @x.query(...

~Gina_M~
Nov 16 '09 #1
Share this Question
Share on Google+
4 Replies


P: 5
Got it!

Select @x.value('(//connectionsettings/add[@key="IgnoreFailure"])[1]/@value', 'varchar(MAX)')

~Gina_M~
Nov 17 '09 #2

Delerna
Expert 100+
P: 1,134
I love it when somone solves their own question.
I love it even more when they let us know.
Good job Gina_M :)
Nov 19 '09 #3

P: n/a
I hate it when this happens, what the devil is @x.value ?
Sep 29 '10 #4

ck9663
Expert 2.5K+
P: 2,878
Steve,

Read this

Good Luck!!!

~~ CK
Oct 1 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.