日期:2014-05-18 浏览次数:20538 次
CREATE PROCEDURE P ( @xml XML OUTPUT ) AS SET @xml=(SELECT TOP 5 ID,Name FROM sysobjects FOR XML PATH('Root') ) GO DECLARE @xml XML EXEC p @xml OUTPUT select MyTable.c.value('./ID[1]','int') AS ID, MyTable.c.value('./Name[1]','nvarchar(50)') AS NAME FROM @XML.nodes('Root') MyTable(c) /* ID NAME 4 sysrowsetcolumns 5 sysrowsets 7 sysallocunits 8 sysfiles1 13 syshobtcolumns */