Yes. We can do it by writing fully qualified names.
The full name of a table is made up of
- Server name
- Database name
- Schema name
- Table name
The full name of a table: Server name.Database name.Schema name.Table name
This is known as Fully qualified name or Four part naming convention.
SELECT * FROM MyServer.YourDB.dbo.Employee
The above SELECT statement can fetch the data from Employee table of YourDB in MyServer Server even though it is not a part of MyDB.