Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Anybody use SYNONYMs?
Old 02-05-2008, 05:06 PM Anybody use SYNONYMs?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
I think this question only applies to Oracle and SQL Server 2005+ users, since I don't think any of the other RDBMS platforms support them.

Access and SQL 2000- do, but in a very roundabout way. You can insert into views (persisted select queries) so you can give a name to a select query for indirection. That's more or less what a real synonym does - it assigns a different name to an object that already exists in your database.

But why? Why would anyone want to do this? Well, lots of reasons.

Security. You're keeping people away from the real tables, and the synonyms themselves can be secured. You can grant a person readonly access to only your synonyms and they won't know about the 100 other tables they shouldn't be looking at. Compatibility - you just made a new table to replace an old one, now you can add a synonym with the old table's name pointing at the new one, and your applications don't need any code level changes. Naming conventions vs simplicity - have it both ways.

This concept has helped me a lot in the past, and we have some smart cookies in here. I wonder what everyone else is up to?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Anybody use SYNONYMs?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18385 seconds with 12 queries