Solved

Is there an equivalent to synonym (oracle) in MS-SQL

Posted on 1998-05-12
5
591 Views
Last Modified: 2012-06-21
Is there an equivalent to synonym (oracle) in MS-SQL ?
0
Comment
Question by:ymailhot
5 Comments
 
LVL 7

Expert Comment

by:spiridonov
ID: 1089666
What is the meaning of synonim in Oracle?
0
 
LVL 2

Expert Comment

by:manand062397
ID: 1089667
SQL Server does not support synonyms but you can create views on table.  Views in SQLSERVER are updateable.  so it works like synonym.
0
 

Author Comment

by:ymailhot
ID: 1089668
In Oracle, if I create a table or a view with the user account TEST, then like in MS SQL Server, other user will have to access the table or view by specifying TEST.tablename.  

In Oracle, there is someting called public synonyms where if I create a public synonym tablename for TEST.tablename, everybody can refer to tablename and this will point to TEST.tablename.

This eliminates the need for hardcodeing TEST in the application, which would be a very bad practice.

I am looking for someting equivalent.  I understand how I could use views but that would involve creating one view for each table for each user.  I find the Oracle synonym solution much cleaner.  That is why I am surprised that MS SQL does not have any equivalent.
0
 
LVL 2

Accepted Solution

by:
odessa earned 50 total points
ID: 1089669
In fact if you create any user account only thing you need to do is to grant access on this user on particular table or view or something else see permissions and you do need to hardcode user that created object code only "tablename"


0
 
LVL 2

Expert Comment

by:manand062397
ID: 1089670
You will be more surprise when you will find a lot of things which are really required but not available in SQL Server.  SQL Server 6.5 is 4-5 years behind  oracle.  We hope SQL Server fills this gap to an extend.    

Not only user name.table name you have to specify database too.....database.owner.table....if bother are in same database then no problem.

of course it is not a good practice to hard code user or database name but a lot features are not supported by sqlserver and this is one of them.....SQLSERVER SUCKS if you have oracle experience..
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question