Loading

"Invalid Cursor State" Error When Connecting to a MS SQL Server Stored Procedure

Julkaisupäivä: Feb 24, 2026
Kuvaus

When connecting to a MS SQL Server stored procedure, the following error message may appear:
 

[Microsoft][SQL Server Native Client] Invalid cursor state.

 

Cause

Stored Procedures can return anything.  This can prove problematic for Tableau where a data source should have a static schema.  Tableau Desktop will end up with the Invalid Cursor state error when stored procedures do not return any result set.  This can be tested by running exec dbo.<sproc name> <parameters> in a third party tool such as SQL Management Studio.  If the command runs with no results tab expect to receive an Invalid Cursor State error in Tableau Desktop.

 

Ratkaisu

Ensure that the stored procedure is returning a result set. The best stored procedure structure is one that defines the return table, inserts data into that table, and returns that table at the end of the procedure.  This ensures a consistent returned schema and one that always returns a result set to Tableau Desktop.

 

Knowledge-artikkelin numero

001473076

 
Ladataan
Salesforce Help | Article