Buy Questpond's video subscriptions on
huge discount
.
Online: 8034
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
Sql Server
>
Loading ...
what is synonym in sql ,what is it purpose [Resolved]
Posted by
Yugandhar
under
Sql Server
on 8/22/2012 |
Points: 10
| Views : 29285 | Status :
[Member]
| Replies : 9
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
what is synonym in sql ,what is it purpose
what type of commands we can use
[Resolved]
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
Muhsinathk
on: 9/14/2012
[Member]
Bronze
|
Points: 50
0
Synonyms
1)A synonyms is a single-part name which can replace multi part name in SQL Statement. Use of synonyms cuts down typing long multi part server name and can replace it with one synonyms. It also provides an abstractions layer which will protect SQL statement using synonyms from changes in underlying objects
2)A synonym is an alternative name for objects such as tables, views, sequences, stored procedures, and other database objects.
Create Synonyms :
USE AdventureWorks;
GO
CREATE SYNONYM MyLocation
FOR AdventureWorks.Production.Location;
GO
Use Synonyms :
USE AdventureWorks;
GO
SELECT TOP 5 *
FROM MyLocation;
GO
Drop Synonyms :
USE AdventureWorks;
GO
DROP SYNONYM MyLocation;
GO
Yugandhar
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Nadh123
on: 8/22/2012
[Member]
Starter
|
Points: 25
0
synonym is a duplicate name of table
server1: emp database name and employee table name
server2 acees this emp table is server1.emp.employee this access the table
select * from server1.emp.employee this access the table
wecan simple create synonym
CREATE SYNONYM S2.EMP FOR SERVER1.EMP.EMPLOYEE
simple select * from S2.EMP EXECUTE THE QUERY
Mahendra
91-9908699686
Yugandhar
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Yugandhar
on: 8/22/2012
[Member]
Starter
|
Points: 25
0
thanks nadh123 for ur ans.
can u explain bit more
like
1.what commands we can use on that and if we change the data in synonym ,then what what is effect on the original table
2.it purpose only to simply the name
Yugandhar
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Nadh123
on: 8/22/2012
[Member]
Starter
|
Points: 25
0
original table effected the data
Mahendra
91-9908699686
Yugandhar
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Yugandhar
on: 8/22/2012
[Member]
Starter
|
Points: 25
0
and 2.purpose
Yugandhar
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Muhsinathk
on: 9/14/2012
[Member]
Bronze
|
Points: 25
0
Please mark as answer if it helpful to you..That helps others who search the same..
Yugandhar
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Hariinakoti
on: 9/17/2012
[Member]
Starter
|
Points: 25
0
Good Work Muhsinathk
Thanks & Regards
Hari
Yugandhar
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Muhsinathk
on: 9/17/2012
[Member]
Bronze
|
Points: 25
0
Thanks..
Yugandhar
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Vikash
on: 9/17/2012
[Member]
Starter
|
Points: 25
0
you can try the following links....
http://www.dbforums.com/microsoft-sql-server/1667196-how-create-synonym-view-entire-database-tables-view.html
Regards,
Vikash Pathak
Yugandhar
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
How to get the exact property name while getting error
(0)
PDB file is not showing Line Number in dot net application hosted on server
(0)
Both Strings morethan 5 letters in length end of the words one vowel and one consonent is different
(0)
how to check Any adjacent letters transposed between two strings(ex: JOHN, JHON)
(1)
can't receive data after success login ?
(1)
Implement Multi-Tenant in Azure Logic Apps
(0)
Why ASP.Net Core 7.0 Web API showing as Connection refused?
(0)
Iterating over columns of dataframe and print as rows in Python Django
(0)
More ...