Re: How can I replace a value in xml with .modify from the variable?
- From: "Farmer" <someone@xxxxxxxxxxxxx>
- Date: Thu, 9 Nov 2006 14:25:26 -0500
Thanks Kent,
I also could not find any better way.
the answer using sp_executesql is:
DECLARE @SQL nvarchar(max)
SET @SQL =
'SET @xml.modify(''replace value of (/Tasks/row/@ConversationHandle)[1] with
"' + cast(@ConversationHandle as char(36)) + '"'');'
SELECT @sql
EXEC sp_executesql
@stmt = @sql
,@params = N'@xml xml OUTPUT'
,@xml = @xml1 OUTPUT
select @xml1
"Kent Tegels" <ktegels@xxxxxxxxxxx> wrote in message
news:b87ad741397a8c8d18706916da0@xxxxxxxxxxxxxxxxxxxxx
Hello Farmer,
Off the top of my head, sp_sqlexcutesql is the only was to do this as the
constructor isn't availble in XQuery DML for SQL Server 2005.
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/
.
- References:
- Prev by Date: RE: Thoughts on storing address data with XML data type?
- Next by Date: RE: Thoughts on storing address data with XML data type?
- Previous by thread: Re: How can I replace a value in xml with .modify from the variable?
- Next by thread: Re: How can I replace a value in xml with .modify from the variable?
- Index(es):
Relevant Pages
|
Loading