

If you have a default schema that you do not own and want to create a synonym, you must qualify the synonym name with the name of a schema that you do own. These references will only be found at run time. However, by dropping a synonym, you run the risk of leaving dangling references to the synonym that was dropped. Therefore, a synonym can be dropped at any time. References to synonyms are not schema-bound. If the Contact table is dropped and replaced by a view named Person.Contact, M圜ontacts now references the Person.Contact view. For example, consider a synonym, dbo.M圜ontacts, that references the Person.Contact table in Adventure Works. Therefore, the base object can be modified, dropped, or dropped and replaced by another object that has the same name as the original base object. All existence, type, and permissions checking on the base object is deferred until run time. The binding between a synonym and its base object is by name only.

You can create synonyms for the following database objects:įour-part names for function base objects are not supported.Ī synonym cannot be the base object for another synonym, and a synonym cannot reference a user-defined aggregate function. Because there is no ALTER SYNONYM statement, you first have to drop the synonym, RemoteObjects.EmpTable, and then re-create the synonym with the same name, but now point the synonym to the new location of the Employee table.Ī synonym belongs to a schema, and like other objects in a schema, the name of a synonym must be unique. Also, if the location of the Employee table changes, you will have to modify the synonym, EmpTable, to point to the new location of the Employee table. Now, the client application only has to use the two-part name, RemoteObjects.EmpTable, to reference the Employee table Server1. To address both these issues, you can create a synonym, EmpTable in a dedicated or existing schema, RemoteObjects, on Server2 for the Employee table on Server1. Also, if the location of the table were to change, for example, to another server, the client application would have to be modified to reflect that change. To reference this table from another server, Server2, a client application would have to use the four-part name. Provides a layer of abstraction that protects a client application from changes made to the name or location of the base object.įor example, consider the Employee table of Adventure Works, located on a server named Server1. Provides an alternative name for another database object, referred to as the base object, that can exist on a local or remote server. There’s that one option that doesn’t belong, and it's your job to find it and flag it to see what score you can get on this quiz.Applies to: SQL Server Azure SQL Database Azure SQL Managed InstanceĪ synonym is a database object that serves the following purposes: It’s true what they say: sometimes the most obvious things are completely invisible (or in this case, the mind).Īnyway, we have a list of funny and interesting historical, geographical and even theatrical facts for you to read through and identify which is the “intruder” among the synonyms/related words. It’s fun and it also tests your knowledge. Here’s what we’ve done: We did our research and pulled together a list of words that have something in common and then threw in there an outlier. But when you have a list of similar words, with the exception of one, does it get harder? Easy enough, right? Well, these are all opposites.
