Hi All,
We have a very complicated Stored Procedure that has quite a few Dynamic Queries. We are having a tough time trying to successfully bring data into Alteryx calling this stored procedure.
If someone can help solve this issue, with below Stored Procedure as an example, it will be greatly appreciated.
CREATE PROCEDURE ProcedureWithDynamicQuery
AS
BEGIN
DECLARE @SelectStatement NVARCHAR(2000)
SET @SelectStatement = 'SELECT GETDATE() '
EXECUTE (@SelectStatement)
END
Thanks
Solved! Go to Solution.
Hi
If i understood your challenge correctly, one way of doing this sort of thing is using the in-db tools.
Gavin,
Will give it a try and get back. Appreciate your input.
Regards,
Nanda Motikane
I think you want to set NOCOUNT on and then, most importantly, use the WITH RESULTS SETS clause to specify the metadata of the resultset. Alteryx should then have all it needs.
CREATE PROCEDURE ProcedureWithDynamicQuery
AS
BEGIN
SET NOCOUNT ON;
DECLARE @SelectStatement NVARCHAR(2000)
SET @SelectStatement = 'SELECT GETDATE() AS DT'
EXECUTE (@SelectStatement) WITH RESULT SETS ((DT DATE))
END
GO
Gavin,
We tried. Could not get it to work with In-Db Tools. Appreciate the help.
Scott,
Your suggestion worked. Appreciate the help.
Regards,
Nanda Motikane