On some enterprise systems, you may have to deal with remote objects that you have no control over. For example, a database maintained by another department or team.
Synonyms can help you separate the name and location of the base object from your SQL code. This way you can encode the synonym table, even if the desired table is moved to a new server / database or renamed.
For example, I could write a query like this:
insert into MyTable (...) select ... from remoteServer.remoteDatabase.dbo.Employee
but then if the server or database, schema or table changes, it will affect my code. Instead, I can create a synonym for the remote server and use the synonym instead:
insert into MyTable (...) select ... from EmployeeSynonym
If the base object changes location or name, I only need to update the synonym to point to a new object.
http://www.mssqltips.com/sqlservertip/1820/use-synonyms-to-abstract-the-location-of-sql-server-database-objects/
source share