![]() ![]() Just you need to drop the Synonym and recreate a new one that points to the new location of that object. You can also move the base object easily to another database on the same server or to another SQL server without performing any change from the application side. If you need to change the database object name, you need only to change the referenced object only in the Synonym definition, by dropping and recreating the Synonym, without the need to visit all places in which object is mentioned. An easy way to perform that is to create a Synonym that references the database object and use that Synonym in your queries. It would seem like a very difficult task, as you need to go through all places in which this object is used. Synonym changes are also transparent from the client application perspective, as no change required from the client side if the Synonym is changed to reference a different database object, as long as the column names are not changed.Īssume that you plan to change the name of a database object that is used heavily in your queries. ![]() It may be found to be very simple from the definition, but for database administrators and developers, it would be very useful and simplify their jobs if it is used in a correct way. You can benefit from Synonyms by providing backward compatibility for the database objects that are used by legacy systems in case you drop or rename that objects. ![]() Synonyms are useful in simplifying complicated and lengthy object names by providing short and friendly alternative names for these database objects. You can imagine Synonyms as a layer of abstraction that provides us with an easy way to connect to and manage the database objects without the need to identify the real name and location for these objects. In this way, it makes the database object more portable and provides more flexibility for the clients to reach and maintain it. The concept of SQL Server Synonyms was introduced the first time in SQL Server 2005 as an alias name that references an existing database object, replacing its fully qualified name. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |