Solved

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

Posted on 1998-05-12
5
593 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 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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

696 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