Return results from 'FOR XML EXPLICIT' in stored procedure output param

Jonny Chleevas

New Member
I have created a SQL Server 2000 stored procedure to return some XML data using \[code\]FOR XML EXPLICIT\[/code\]. This is working fine in itself, however I'm having trouble figuring out how to get the XML results returned by the stored procedure in an output parameter (as I want to call this one from another SP).I've tried options such as the following but just can't seem to get it to work!\[code\]CREATE PROCEDURE [dbo].[MyProc] @user_index INT, @xml_data VARCHAR(8000) OUTPUTASBEGIN SELECT @xml_data = http://stackoverflow.com/questions/12602564/1 AS Tag ,0 AS Parent ... ... UNION ALL SELECT 2 AS Tag ,1 AS Parent ... ... FOR XML EXPLICITEND\[/code\]Any ideas where I'm going wrong?
 
Back
Top