T-SQL – Synonyms

Synonym
It is an alternative name for an existing database object (i.e. table, function, procedure, view, …). You can shorten your query using synonyms.
Synonyms are not allowed in DDL queries.

CREATE SYNONYM OurProducts FOR TSQL2012.Production.Products; --create
SELECT * FROM OurProducts; -- use
DROP SYNONYM OurProducts; -- remove
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