I get an error message 'Must declare the table variable "@myDoc"' when I try to edit this XML variable.
I can't see where I'm going wrong. Anybody see what I have got wrong?
Dazed and confused
N+, MCDBA 2000, MCAD .NET
I can't see where I'm going wrong. Anybody see what I have got wrong?
Code:
declare @myDoc XML;
set @myDoc =
'<root><ProductDescription ProductID="500"
ProductName="SQL Server 2005">
<Editions>
<Edition>Standard</Edition>
<MaximumCPU>4</MaximumCPU>
</Editions>
</ProductDescription>
</root>';
select * from @myDoc;
UPDATE @myDoc
SET xmlcol.modify('delete /root/ProductDescription[@ProductID="500"]');
select @myDoc.value
('(/root/ProductDescription/@ProductID)[1]','int');
Dazed and confused
N+, MCDBA 2000, MCAD .NET