<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>20 Feb 2021 08:56:22 Z</lastBuildDate><pubDate>20 Feb 2021 08:15:34 Z</pubDate><description>Hi,&#13;
Anyone tried retrieving output of MSSQL stored procedure with 2 different result&#13;
here is the sample of stored procedure&#13;
&#13;
ALTER PROCEDURE [dbo].[spTest]&#13;
(@pVal1 INT = 0)&#13;
AS&#13;
BEGIN&#13;
       SET NOCOUNT ON;&#13;
       IF @pVal1 = 0 &#13;
              BEGIN&#13;
                   SELECT 'two columns' AS COL1, 'COL2' AS COL2&#13;
              END&#13;
       ELSE &#13;
	      BEGIN&#13;
                   SELECT 'one column only' AS COL1&#13;
              END&#13;
END&#13;
&#13;
But when i make the sp like this i can retrieve this &#13;
&#13;
ALTER PROCEDURE [dbo].[spTestOK]&#13;
(@pVal1 INT = 0)&#13;
AS&#13;
BEGIN&#13;
       SET NOCOUNT ON;&#13;
       IF @pVal1 = 0 &#13;
              BEGIN&#13;
                   SELECT 'two columns' AS COL1, 'COL2' AS COL2&#13;
              END&#13;
       ELSE &#13;
	      BEGIN&#13;
                   SELECT 'one column only' AS COL1, 'COL2' AS COL2&#13;
              END&#13;
END&#13;
&#13;
Im using WD25 and SQL Native Driver</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68294-retrieve-mssql-stored-procedure/read.awp</link><title>Retrieve MSSQL stored procedure</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>JOHNKEN</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68294-retrieve-mssql-stored-procedure-68295/read.awp</comments><pubDate>20 Feb 2021 08:56:22 Z</pubDate><description>Working already, thanks.</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68294-retrieve-mssql-stored-procedure-68295/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68294-retrieve-mssql-stored-procedure-68295/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68294-retrieve-mssql-stored-procedure/read.awp">Retrieve MSSQL stored procedure</source><title>Re: Retrieve MSSQL stored procedure</title></item></channel></rss>
