<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>4 Aug 2020 14:47:14 Z</lastBuildDate><pubDate>30 Jul 2020 19:54:13 Z</pubDate><description>Hi everyone,&#13;
&#13;
I'm having issues getting a return value from a stored procedure on MSSQL. Here's my SQL code:&#13;
&#13;
[code:sql]&#13;
ALTER PROCEDURE [dbo].[createEmployeeShift]&#13;
(&#13;
	@employeeID varchar(38),&#13;
	@equipmentID varchar(38)&#13;
)&#13;
AS&#13;
&#13;
DECLARE @ID uniqueidentifier = NEWID()&#13;
&#13;
INSERT INTO dbo.EmployeeShift VALUES(@ID,@employeeID,GETDATE(),NULL,@equipmentID)&#13;
&#13;
SELECT @ID AS ID&#13;
[/code]&#13;
&#13;
When I run this stored procedure in MSSQL Management Studio, the stored procedure returns the generated ID as normal. However, when I do the same query and I do HReadFirst in WinDev, it says the data source has not been initialized. I'm kinda lost because I've had this kind of stored procedure work great before, but I can't get this one to work. Here's my WinDev code:&#13;
&#13;
[code:wl]&#13;
sQuery is string&#13;
dsData is Data Source&#13;
&#13;
sQuery = "EXEC dbo.createEmployeeShift '" + sEmployeeID + "', '" + sEquipmentID + "'"&#13;
&#13;
IF HExecuteSQLQuery(dsData,gctSQLConnection,hQueryWithoutCorrection,sQuery) THEN&#13;
	IF HReadFirst(dsData) THEN&#13;
		gsShiftID = dsData.ID&#13;
		&#13;
		EDT_ShiftStartTime = SysDateTime()&#13;
		&#13;
	END&#13;
END&#13;
[/code]&#13;
&#13;
Does anyone has an idea on why I'm unable to get the ID from the stored procedure into WinDev?&#13;
Thanks in advance.</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure/read.awp</link><title>Getting the returned set of a MSSQL stored procedure</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>Clages1</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure-67922/read.awp</comments><pubDate>4 Aug 2020 14:47:14 Z</pubDate><description>Do this way  works fine&#13;
i use MSSQLserver with windev  using Native conector&#13;
&#13;
////     Pega Qt Usuarios Conectados no Banco d…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure-67922/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure-67922/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure/read.awp">Getting the returned set of a MSSQL stored procedure</source><title>Re: Getting the returned set of a MSSQL stored procedure</title></item><item><author>jolain.poirier</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure-67918/read.awp</comments><pubDate>31 Jul 2020 16:10:44 Z</pubDate><description>Thanks for the reply Andrea but unfortunately this syntax does not work in MSSQL. However I was able to make it work. :)&#13;
&#13;
I ha…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure-67918/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure-67918/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure/read.awp">Getting the returned set of a MSSQL stored procedure</source><title>Re: Getting the returned set of a MSSQL stored procedure</title></item><item><author>Andrea Chiadò Piat</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure-67917/read.awp</comments><pubDate>31 Jul 2020 10:04:18 Z</pubDate><description>Hi Dev,&#13;
I never tried with MSSQL, but I use select from store procedure with FirebirdSQL and I use this query definition:&#13;
&#13;
sQ…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure-67917/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure-67917/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/67916-getting-returned-set-mssql-stored-procedure/read.awp">Getting the returned set of a MSSQL stored procedure</source><title>Re: Getting the returned set of a MSSQL stored procedure</title></item></channel></rss>
