SQLzoo.net

Read tables from another schema/database

SQL Server
A particular server may support a number of different sets of tables. In Oracle these are schemas in MySQL they are databases. In both cases each user normally has their own set of tables, other users tables may be accessed using a dot notation.


Specific to SQL Server
To connect to a table called table on a database called onedb, you need to know the owner of the schema for which that database is defined. Most tables default to schema owner dbo. So, you would type: select * from onedb.dbo.table If you have more than one MS server installed, add the server to the beginning of the string: select * from server1.onedb.dbo.table

Related links:

  • USERS