SQL type 'xml' is not supported in xquery


hi all,

i not able insert sql:variable xml nodes....

am getting "sql type 'xml' not supported in xquery".  need insert series of xml node other node of same xml.

could 1 advice me how proceed further...?  there alternative way this..

btw, using sql server 2005, if not supported patches run rid off error in existing sql server 2005 itself.

anand rajagopal

sure anand, here's simplified example.

declare @a xml;
declare @b xml;

set @a = '<foo/>';
set @b = '<bar/>';

-- sql server 2005 version
declare @sqlstring nvarchar(2000);
set @sqlstring = 'set @a.modify(''insert ' + convert(nvarchar(100), @b) + ' /foo[1]'')';
execute sp_executesql @sqlstring, n'@a xml output, @b xml', @a output, @b;
select @a;

-- in sql server 2008, can this:
-- set @a.modify('insert sql:variable("@b") /foo[1]')
-- select @a 

cheers, bob beauchemin, sqlskills



SQL Server  >  SQL Server XML



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'