![]() The following example uses the CREATE SYNONYM statement to create a synonym for the sales.orders table: CREATE SYNONYM orders FOR sales.orders A) Creating a synonym within the same database example Let’s take some examples of using the CREATE SYNONYM statement to get a better understanding. SQL Server CREATE SYNONYM statement examples Note that the object for which you create the synonym does not have to exist at the time the synonym is created. Second, provide the name of the synonym after the CREATE SYNONYM keywords.First, specify the target object that you want to assign a synonym in the FOR clause.To create a synonym, you use the CREATE SYNONYM statement as follows: CREATE SYNONYM synonym_nameĬode language: SQL (Structured Query Language) ( sql ) SQL Server CREATE SYNONYM statement syntax A synonym provides you with many benefits if you use it properly. In SQL Server, a synonym is an alias or alternative name for a database object such as a table, view, stored procedure, user-defined function, and sequence. Summary: in this tutorial, you will learn about SQL Server synonym and how to create synonyms for database objects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |