为了保持尽可能简单,我刚刚复制了导致错误的代码行。我试图在存储过程中运行openquery并继续收到以下错误:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '*'.
我很确定这与我引用的地方有关但我真的需要第二双眼睛,因为我尝试了各种组合:
SET @SQL_ResultID = 'SELECT * FROM OPENQUERY([23-SQL3000], ''SELECT ResultID FROM [Portfolio].[dbo].[Program] P INNER JOIN [Portfolio].[dbo].[Results] A ON P.ProgramID = A.ProgramID WHERE ProgramName = ''''' + @P + ''''' AND ResultsName = ''''' + @A + ''''''')';
提前致谢