Heres the stored proc I created to do generic dynamic openquery selects...
CREATE PROCEDURE [dbo].[LinkedServerQuery]
(
@LinkedServerName varchar(50),
@SQL varchar(max)
)
AS
BEGIN
DECLARE @LinkedSQL varchar(max)
SET @LinkedSQL = 'SELECT * FROM OPENQUERY(' + @LinkedServerName + ','''+ REPLACE(@SQL, '@',...