Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

No Columns Returned for Stored Procedure

MichaelAd
Alteryx
Alteryx
Created

When running a Stored Procedure from the Input or Dynamic Input tool the following error (or similar) will occur.

 

Error opening "EXEC StoredProcedure": "No Columns Returned"


image.png

  • Alteryx Designer
    • Versions All
  • SQL Server
    • 2008R2 +


Cause #1:
Both Input tool as well as the Dynamic Input tool require in the main SQL section a statement that returns columns.

Cause #2:
ODBC connection throws this error, but OLEDB does not. 
Defect: TDCB-3694 - SQL Server ODBC errors No Columns Returned with Stored Procedure. 
Status: Open.



Resolution for Cause #1:
Amend the Stored Procedure to return columns by modifying the SQL query of the Stored Procedure on the database side. If you are unsure how to do that you can work on it together with your DBA.


Resolution for Cause #2:
Defect TDCB-3694 is target for resolution in future release.

Workaround #1:
Connect using an OLEDB connection instead of an ODBC connection and re-test the Stored Procedure as is.

Workaround #2:
If you add the metadata at the end of the stored procedure, it runs successfully without any error. You can define the result set when calling the stored procedure, like this: 

image.png

Workaround #3:
Alternatively, the Stored Procedure can be called within the Pre- or Post-SQL query section of the Input tool.

Additional Resources

Comments
lepome
Alteryx Alumni (Retired)

The resolution above also works when no Stored Procedure is used.  If the SQL statement in the Query slot doesn't return any data, for example, because it just modifies a table, the No Columns Returned error will occur because the Input Data and Dynamic Input tools require that some data be returned even if you don't need that data and don't use it anywhere in your workflow. 

SELECT 1 AS dummy from DUAL;

works for Oracle.
Other databases don't even require a table be specified

SELECT 1 AS dummy;

works for SQL Server.