Friday, March 30, 2012

How can I concatenate fields XML in Yukon?

for example:
XML 1: <CAR name="1">
XML 2: <CAR name="2">
XML expected:
<CAR name="1">
<CAR name="2">
Thank.Hello sqlextreme,
declare @.x1 xml,@.x2 xml
set @.x1 = '<CAR name="1"/>'
set @.x2 = '<CAR name="2"/>'
set @.x1 = cast(cast(@.x1 as varbinary(max))+cast(@.x2 as varbinary(max)) as
xml)
select @.x1
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/|||thank you for your Help, Kent Tegels|||Alternatively:
select @.x1, @.x2 for xml path(''), type
Best regards
Michael
"Kent Tegels" <ktegels@.develop.com> wrote in message
news:b87ad74179638c8dba6374e0e30@.news.microsoft.com...
> Hello sqlextreme,
> declare @.x1 xml,@.x2 xml
> set @.x1 = '<CAR name="1"/>'
> set @.x2 = '<CAR name="2"/>'
> set @.x1 = cast(cast(@.x1 as varbinary(max))+cast(@.x2 as varbinary(max)) as
> xml)
> select @.x1
> Thanks,
> Kent Tegels
> http://staff.develop.com/ktegels/
>

No comments:

Post a Comment