Getting Started with Adobe After Effects - Part 6: Motion Blur
This module helps you to share, discuss and learn interview questions and answers of different technologies

what is Synonyms?

Nov 5 2011 10:13PM by Nirav Gandhi   

Question

what is Synonyms?

Answer

A synonym is a database object that serves the following purposes:

Provides an alternative name for another database object, referred to as the base object, that can exist on a local or remote server.

Provides a layer of abstraction that protects a client application from changes made to the name or location of the base object.

Example:

CREATE TABLE SYNONYM_Temp

( id INT IDENTITY(1, 1), varName VARCHAR(50) )

CREATE SYNONYM Bank FOR SYNONYM_Temp

--Step :1

INSERT INTO Bank(varName)VALUES ('ICIC')

INSERT INTO Bank(varName)VALUES ('HSBC')

INSERT INTO Bank(varName)VALUES ('HDFC')

INSERT INTO Bank(varName)VALUES ('CITY')

SELECT * FROM Bank-->SYNONYM SELECT * FROM SYNONYM_Temp-->Origional Table

--Step :2

DELETE FROM Bank WHERE ID= 4

SELECT * FROM Bank

---Step :3

UPDATE Bank SET varName= 'CITY' WHERE ID= 3

SELECT * FROM Bank

---Step :4, you can not change the Structure of Table

ALTER TABLE bank ADD Col3 VARCHAR(50)

DROP SYNONYM Bank

Note: using SYNONYM You can Hide the origional definition of database object. Note: the name of a synonym must be unique. Note: You can create synonyms for database objects.

Read More..   [0 clicks]

Published under: SQL Server Interview Questions ·  ·  ·  · 


Nirav Gandhi
38 · 5% · 1517
0
Liked
 
0
Asked



Submit

Your Comment


Sign Up or Login to post a comment.

"what is Synonyms?" rated 5 out of 5 by 2 readers
what is Synonyms? , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]