I have many stored procedures within a SQL Server database which get called from different Excel workbooks, but this one refuses to run.
The stored procedure runs within SQL Server and runs as expected in MS Access 2010 as a query
exec V2_PltOvrVw
However when I try to pull the same result into Excel using my normal methods:
DATA TAB - Connections - Add
DEFINITION TAB - Command Type = SQL - Command Text = dbo.exec V2_PltOvrVw
In a cell I then go to existing connections and open my newly created db link I get the following unhelpful message
The query did not run or the database table could not be opened Check the database server or contact your database administrator. make sure the external database is available and hasn't been moved or reorganized, then try again
on clicking OK I then get
The following data range failed to refresh ExternalData_1 Continue to refresh all?
The only differences I can see are that this stored procedure firstly writes to 6 temporary tables before joining them all together and creating an aggregated output.
I have also tried to copy the sp code directly into the command text but that does not work either, suggesting that there is a real reason for this that I do not yet understand.