• Re: "OpenQuery does not accept variables" --

    This runs fine in my set-up:

    Select * from OpenQuery(MyLinkedServer,'Declare @name varchar(50) Set @name=''RemoteDB'' Select * from sys.databases where name=@name')

    Note the declaration of the variable within the query statement (and the assignment of a value with double quotes).

    HTH

    Elliott