22,209
社区成员
发帖
与我相关
我的任务
分享
create proc test_proc @xml xml
as
begin
select name=t.c.value('@name[1]','nvarchar(20)') from @xml.nodes('/root/tag') T(c)
end
declare @t xml
select @t= '<?xml version="1.0" encoding="GB2312" ?>
<root>
<tag name="艾滋病"></tag>
<tag name="健康"></tag>
</root> '
exec test_proc @t
--------------------
name
--------------------
艾滋病
健康
(2 行受影响)