Update Empty XML Tag in SQL Server
- by monO
I'm trying to update an empty XML Tag in my Xml string on sql server; it says the row is updated when i run the following script, but when I view the XML; nothing has changed:
Declare @newValue varchar(100)
select @newValue = '01'
update dbo.UploadReport
set XmlTest.insert('replace value of (/CodeFiveReport/Owner/AgencyID/text())[1] with sql:variable("@newValue")')
where id = 'myId'
The xml after still appears as this in the databse
<AgencyID />
What am I doing wrong?
I've tried @AgencyID without the text() at the end and still no avail...