答案 0 :(得分:1)
DECLARE @test TABLE(MyXml xml, MyVal nvarchar(max))
INSERT INTO @test
Values(N'<Name>
<Fname>A</Fname>
<Lname>AAA</Lname>
</Name>',''),
(N'<Name>
<Fname>B</Fname>
<Lname>BBB</Lname>
</Name>','')
UPDATE @test
SET
MyVal = MyXml.value('(Name/Fname/.)[1]','nvarchar(max)')
SELECT *
FROM @test t