Reply
Anybody use SYNONYMs?
Old 02-05-2008, 04:06 PM Anybody use SYNONYMs?
Learning Newbie's Avatar
Moderator

Latest Blog Post:
What Does This Look Like?
Posts: 4,710
Name: John Alexander
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?
__________________
4 ways to improve the lives of the "bottom billion"

"HEY YOU KIDS GET OFF MY LAWN!" -John McCain
Learning Newbie is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Reply     « Reply to Anybody use SYNONYMs?
 

Thread Tools

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

vB 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.10714 seconds with 13 queries