?
Solved

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

Posted on 1998-05-12
5
Medium Priority
?
598 Views
Last Modified: 2012-06-21
Is there an equivalent to synonym (oracle) in MS-SQL ?
0
Comment
Question by:ymailhot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 150 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

765 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