Question: While in Management Studio, I am trying to run a query/do a join between two linked servers.
Is this a correct syntax using linked db servers:

```
select foo.id 
from databaseserver1.db1.table1 foo, 
     databaseserver2.db1.table1 bar 
where foo.name=bar.name

```

Basically, do you just preface the db server name to the db.table ?

Answer: 
If you still find issue with `<server>.<database>.<schema>.<table>`

Enclose server name in `[]`
Usually direct queries should not be used in case of linked server because it heavily use temp database of SQL server. At first step data is retrieved into temp DB then filtering occur. There are many threads about this. It is better to use open OPENQUERY because it passes SQL to the source linked server and then it return filtered results e.g.

```
SELECT *
FROM OPENQUERY(Linked_Server_Name , 'select * from TableName where ID = 500')

```