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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
AartiRank #2,383 · 594 reputationPosted Dec 22, 2011, 11:08 PM EST
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
Vikrant Jadhav64 reputationPosted Dec 22, 2011, 9:47 PM EST
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".
Farukh Mujawar106 reputationPosted Dec 29, 2011, 8:46 PM EST
AartiRank #2,383 · 594 reputationPosted Dec 29, 2011, 9:07 PM EST