I have a Stored Procedure (SP) in which I pass in one value. In this SP, I am trying to create/populate a Temp Table from the result of another SP that is on a Linked/remote
With the usual disclaimers about guarding dynamic SQL, you can do this without OPENQUERY etc. Just call sp_executesql remotely:
DECLARE @sql NVARCHAR(MAX); SET @sql = N'EXEC thelinkedSPname ' + @param1 + ';'; INSERT #temptable EXEC [LinkedServerName].database.dbo.sp_executesql @sql;