What is Synonym in SQL Server ?

  • Synonym is one of the object in SQL Server.
  • Synonym is physical representation of data.
  • We can’t create synonym based on more than one table.
  • Synonym is invalid whenever table is dropped and changes the structure of table.

How to create synonym in SQL Server:

Syntax:

create synonym <synonym-name> for <table-name>

Example:

create synonym  my_synonym for emp

// Here I am created synonym object with the name my_synonym on emp table.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s