October 16, 2008 at 8:29 am
hi,
I want to query an XML column. I've put together a sample (See attached text file). The goal is to say, return the value of sample2.
When i'm trying to query it, i'm just getting null, I'm missing something obvious, can someone else try it and post their select back.
Thanks,
Jackal
P.S - Had a bit of trouble upload it, so tried a zip file. Let me know if any problems.
October 16, 2008 at 8:35 am
select r.value('number[1]','decimal(10,3)') as Sample2Value
from SampleXML
cross apply Data.nodes('/wddxPacket/data/struct/var/struct/var[@name="Sample2"]') as x(r)
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537October 16, 2008 at 8:38 am
Thank you,
I've spotted my mistakes now, thanks for posting up your select, i'd of spent weeks looking at mine if I didnt have something to compare it to.
Thanks again,
Jackal.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply