create proc Fetchxmloutput(@x xml output ) as begin set @x=(select EmployeeID,LastName,FirstName from dbo.Employees where EmployeeID=4 or EmployeeID=5 for xml raw ,type) end
执行存储过程:
declare @xml xml exec Fetchxmloutput @x=@xml output select @xml
创建存储过程(数据库为NORTHWIND\NORTHWND.MDF):create proc Fetchxmloutput(@x xml output )asbeginset @x=(select EmployeeID,LastName,FirstName from dbo.Employees where EmployeeID=4 or