Cross server query (Sql Server)

When using sql server query crossing 2 or more server in the same query.
try this

select * from OPENDATASOURCE(
‘SQLOLEDB’,
‘Data Source=111.111.111.11;User ID=uid;Password=pass’
).DBName.dbo.TableName

But if you query crossing 2 or more database form 1 server.
try this

select * from DBName.dbo.TableName