Thanks for your help.It worked when i modified the procedure like this(using output variable):CREATE PROCEDURE SomeProc (@xmlvar xml output) ASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; set @xmlvar=(SELECT Employees.EmployeeID, Employees.LastName, Employees.FirstName, Orders.OrderID, Orders.OrderDate, Orders.EmployeeID FROM Orders INNER JOIN Employees ON Orders.EmployeeID = Employees.EmployeeID ORDER BY Employees.EmployeeID ASC FOR XML AUTO)ENDGO
and running the following scriptdeclare @retXml xmlexec SomeProc @xmlvar=@retXml outputselect @retXml as 'gamwthpoutanamou'
However, is there a way to achieve this without the need of modifying my procedure??It would be better if i didnt change my original procedure.I tested the following, but it didnt work:declare @retXml xmlexec @retXml=SomeProc2select @retXml
error message:Operand type clash: int is incompatible with xmlThnaks in advance