Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Undeclared prefix in XML for SQL Server 2012

$
0
0

I am currently trying to create a stored procedure that creates an xml node when a user enters data within my website. Below is a sample of my stored procedure:

Code:

Declare @Term XML = '<wma:Term>My First Term</wma:Term>'
Declare @x XML
Select @x = MetaData from [Products] where Id = 1
Set @x.modify ('declare namespace wma="http://www.google.com/wma"; insert sql:variable("@Term") as last into (/wma:WMA/wma:List)[1]

I have tried to declare the namespace withing the insert however I continue to receive the "undeclared prefix" error message. The Expect results I am looking for is as follows:

<wma:WMA xmlns:wma="http://www.google.com/wma"><wma:List><wma:Term>My First Term</wma:Term></wma:List></wma:WMA>
What am I doing wrong? Or is this above mentioned not capable?


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>