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?