Export (0) Print
Expand All

Create Synonyms


This topic describes how to create a synonym in SQL Server 2014 by using SQL Server Management Studio or Transact-SQL.

In This Topic

To create a synonym in a given schema, a user must have CREATE SYNONYM permission and either own the schema or have ALTER SCHEMA permission. The CREATE SYNONYM permission is a grantable permission.

To Create a Synonym

  1. In Object Explorer, expand the database where you want to create your new view.

  2. Right-click the Synonyms folder, then click New Synonym….

  3. In the Add Synonym dialog box, enter the following information.

    Synonym name

    Type the new name you will use for this object.

    Synonym schema

    Type the schema of the new name you will use for this object.

    Server name

    Type the server instance to connect to.

    Database name

    Type or select the database containing the object.


    Type or select the schema that owns the object.

    Object type

    Select the type of object.

    Object name

    Type the name of the object to which the synonym refers.

Arrow icon used with Back to Top link[Top]

To Create a Synonym

  1. Connect to the Database Engine.

  2. From the Standard bar, click New Query.

  3. Copy and paste the following examples into the query window and click Execute.

The following example creates a synonym for an existing table in the AdventureWorks2012 database. The synonym is then used in subsequent examples.

USE tempdb;
FOR AdventureWorks2012.Person.AddressType;

The following example inserts a row into the base table that is referenced by the MyAddressType synonym.

USE tempdb;
INSERT INTO MyAddressType (Name)
VALUES ('Test');

The following example demonstrates how a synonym can be referenced in dynamic SQL.

USE tempdb;
EXECUTE ('SELECT Name FROM MyAddressType');

Arrow icon used with Back to Top link[Top]

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft