In general when we execute stored procedure we will get output in tabular format but here question is we want output in XML format. Is this possible or if it is possible then how?
Thanks in advance.
Thanks & Regards
Farukh
Thanks & Regards
Farukh
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
AartiPosted Dec 23, 2011, 4:08 AM
Hi Farukh,
I had tried this:
-- create a table
create table Employee(id int, name varchar(10));
-- insert data into table
insert into Employee values(1,'df'),(2,'fg'),(3,'sfs'),(4,'dd');
--- check rows in table
select * from Employee
-- sproc to get sql output in XML
CREATE PROCEDURE sp_GetExplicitXML
AS
SELECT emp.id,emp.name
FROM Employee emp
FOR XML PATH ('Entry') ,ROOT('XML')
-- execute sproc sp_GetExplicitXML
exec sp_GetExplicitXML
AartiPosted Dec 30, 2011, 2:07 AM
Farukh MujawarPosted Dec 30, 2011, 1:46 AM
Vikrant JadhavPosted Dec 23, 2011, 2:47 AM
It is possible to get Output in XML format after execution of Store Procedure.
Refer the following link
http://www.perfectxml.com/Articles/XML/ExportSQLXML.asp
Thanks & Regards
Vikrant Jadhav
If this post is helpful to you then Mark as a "Correct Answer".