Qualifying Table Names

When accessing tables that exist in your Oracle user account, the table can be selected simply by its unqualified name. Accessing tables in other Oracle schemas requires that the schema name be prefixed to the table name with a single period (.). Oracle synonyms can provide additional location transparency.

Microsoft SQL Server uses a different convention when it references tables. Because one SQL Server login account can create a table by the same name in multiple databases, the following convention is used to access tables and views: [[database_name.]owner_name.]table_name

Accessing a table in… Oracle Microsoft SQL Server
Your user account SELECT *
FROM STUDENT
SELECT * FROM USER_DB.STUDENT_
ADMIN.STUDENT
Other schema SELECT * FROM STUDENT_ADMIN.STUDENT SELECT * FROM OTHER_DB.STUDENT_
ADMIN.STUDENT

Here are guidelines for naming Microsoft SQL Server tables and views:

At the same time, other users in these databases might own objects by the same name:

Therefore, it is recommended that you include the owner name as part of the reference to a database object. If the application has multiple databases, it is recommended that the database name also is included as part of the reference. If the query spans multiple servers, include the server name.

The object’s owner can be omitted by separating the database and table name by two periods. For example, if an application references STUDENT_DB..STUDENT, SQL Server searches as follows:

  1. STUDENT_DB.current_user.STUDENT
  2. STUDENT_DB.DBO.STUDENT

If the application uses only a single database at a time, omitting the database name from an object reference makes it easy to use the application with another database. All object references implicitly access the database that is currently being used. This is useful when you want to maintain a test database and a production database on the same server.