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: 
**For those having trouble with these other answers** , try [`OPENQUERY`](https://learn.microsoft.com/en-us/sql/t-sql/functions/openquery-transact-sql)

Example:

```
 SELECT * FROM OPENQUERY([LinkedServer], 'select * from [DBName].[schema].[tablename]') 

```
Have you tried adding " around the first name?

like:

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

```