March 24, 2009 at 7:02 am
Why does the below code not replace the value with 100? Not sure what I'm doing wrong. The value still remains 50 after modify().
declare @xml xml
select @xml = '
'
set @xml.modify('replace value of (/Test/@value)[1] with "100"')
select @xml
March 24, 2009 at 7:51 am
Hi
Please either mask your xml < and > or attach an example file. 😉
Greets
Flo
March 24, 2009 at 8:40 am
Sorry, missed it!
Why does the below code not replace the value with 100? Not sure what I'm doing wrong. The value still remains 50 after modify().
declare @xml xml
select @xml = '
'
set @xml.modify('replace value of (/Test/@value)[1] with "100"')
select @xml
March 24, 2009 at 8:55 am
Hi
Maybe just attach a text file with your sample. 😉
Greets
Flo
March 24, 2009 at 9:07 am
Aah, here's what's to be substituted into @xml.
March 24, 2009 at 9:17 am
VM (3/24/2009)
Aah, here's what's to be substituted into @xml.
Perfect! 🙂
Try this:
declare @xml xml
select @xml = '<Test>
<value>50</value>
</Test>'
set @xml.modify('replace value of (/Test/value/text())[1] with "100"')
select @xml
Greets
Flo
March 27, 2009 at 11:09 am
Thanks Flo! Perfect! 🙂
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply