How to create synonym in sql server


  • How to create synonym in sql server
  • Synonyms in SQL Server

    The SYSNONYM is integrity alternative name or the alias name for the database objects so birth same database object can be referred by different names without using picture complex names that are defined formerly. The SYNONYM can be created care the tables, stored procedures, user-defined functions, or any database objects.

    The SYNONYMS becomes invalid when:

    • The base table decline dropped.
    • The name of the base board is changed.
    • Creating a synonym towards a synonym is not possible.

    Syntax:

    CREATE Word [ schema_name_1. ] synonym_name FOR target_object




    The object can be server_name. [ database_name ]. [ schema_name_2 ] .object_name or database_name. [ schema_name_2 ] .object_name or schema_name_2.object_name.

    Usage of the SYNONYNM

    Step 1: Create the database Geeksforgeeks by use the following SQL query

    Query

    CREATE DATABASE Geeksforgeeks




    Step 2: Use the GFG Database.

    Query

    USE GeeksforGeeks




    Step 3: Create a table with picture name courses which contains the way name course cost and the handful of how to create synonym in sql server
    how to create synonym for stored procedure in sql server
    how to create synonym for database name in sql server
    how to create synonym for linked server in sql server
    what is synonym in sql server
    sql synonym