Execute stored proc with OPENQUERY

This worked for me,

SELECT * FROM OPENQUERY(LOCALSERVER, 'SET FMTONLY OFF EXEC snr.dbo.GetAllSignals @controlRunId = 25, @experimentRunId = 26')

I was creating temporary tables, and that's why i got access denied

Here is more info http://www.sommarskog.se/share_data.html#OPENQUERY


I create a sp that doesn't return any value and it doesn't work. Your SP in mysql have to return a value! for example I do this in "mysql":

CREATE DEFINER=`root`@`localhost` PROCEDURE `MyPro`(IN `Name` VARCHAR(50), IN `Id` INT, OUT `Result` INT)
MODIFIES SQL DATA
BEGIN
DECLARE Result INT;
    SET Result = 0;
INSERT into MyTable (Id,Name)  VALUES(Id,Name);
SELECT Result;

END

That "Id" and "Name" is input parameter and "Result" is output parameter and create linked server in SQL SERVER and call it like this:

select * from openquery
(
    Test,'call mydb.MyPro(''Name'',''16'', @P0);'
)

It works for me :D