KNOWLEDGE BASE

Error "The stored procedure ... does not return a result set" Connected to a Stored Procedure


Published: 17 Dec 2013
Last Modified Date: 13 Nov 2017

Issue

When you try to connect to a stored procedure, the following error might occur:
 
The stored procedure "[<database name>].[<stored procedure name>]" does not return a result set.
Unable to connect to server "<server name or IP address>". Check that the server is running and that you have access privileges to the requested database

Environment

  • Tableau Desktop 
  • Microsoft SQL Server
  • Stored procedure without a SET NOCOUNT ON statement

Resolution

Add a SET NOCOUNT ON statement to the beginning of the stored procedure.

The issue may also occur when using a temporary table inside of a stored procedure.

Cause

The SQL Server ODBC driver forces Tableau to use server-side cursors in most scenarios, and the Microsoft ODBC driver has known issues with supporting metadata queries and result set retrieval for certain cursor types when temporary tables are involved.

Tableau writes the results of Stored Procedures to a temporary table automatically, and reads from the temporary table instead of executing the Stored Procedure every time (unless the input parameters to the procedure change).
Did this article resolve the issue?