Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 retrive xml as output

Author  Topic 

lazydev
Starting Member

16 Posts

Posted - 2008-04-24 : 12:47:03
My execution fails .
Cannot we retrive xml from stored procedures.

CREATE PROCEDURE USP_XML_TEST (@no int ,@var xml output)
AS
BEGIN
SET NOCOUNT ON;
select @var = details_xml from student where student_id = @no
END
GO

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2008-04-24 : 13:38:37
Works for me. Do you get an error?


create table myStudent (student_id int, details_xml xml)
insert myStudent select 1, '<root><a><b/></a></root>'
go

CREATE PROCEDURE USP_XML_TEST (@no int ,@var xml output)
AS
BEGIN
SET NOCOUNT ON;
select @var = details_xml from myStudent where student_id = @no
END
go

declare @var xml
EXEC USP_XML_TEST 1, @var output
select @var

/* Output
<root><a><b /></a></root>
*/


Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page
   

- Advertisement -