April 8, 2013 at 3:32 am
Dear All
The way we hide the tbale name from user by using the synonyms. Is there a way to hide the column name.
Regards
Krishna1
April 8, 2013 at 3:49 am
Create a VIEW?
---------------------------------------------------------
It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens[/url]
Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
April 8, 2013 at 4:00 am
In that case we need to create views for all the tables. Is there any other way?
April 8, 2013 at 5:58 am
Do you have an example of what you are trying to acheive ?
________________________________________________________________________________________________
Regards
Steve
SQL 2008 DBA/DBD - MCTS/MCITP
Please don't trust me, test the solutions I give you before using them.
April 8, 2013 at 6:11 am
As far as i know, a SYNONYM must point to an object, that is, something that exists in sys.objects. that's typically, a table/view/procedure/function, but could technically be anything that exists in sys.objects.
if you need to modify the name of a column, the suggested action of creating a view is the only way to change something like MySynonym.GF53SD to be MySynonym.CorporationName
That is what you are trying to do right? either clear up the purpose of a column, or abstract it away from the real column name?
Lowell
April 8, 2013 at 7:31 am
if my table is customer having column col1,col2 ...
in the select query i want all the developners to access it in the query as
select customercode, customername
from mycstomer
instead of
select col1, col2
from cutomer
please note that i just give column names as col1,col2 for eg purpose. In real db it has got meaningful names
April 8, 2013 at 7:48 am
Krishna1 (4/8/2013)
if my table is customer having column col1,col2 ...in the select query i want all the developners to access it in the query as
select customercode, customername
from mycstomer
instead of
select col1, col2
from cutomer
please note that i just give column names as col1,col2 for eg purpose. In real db it has got meaningful names
yes, in that case you'll have to create a view witht eh aliases on the column names.
no other way to do it.
Lowell
April 8, 2013 at 7:58 am
Unfortunately - you will need to create views to reflect the field names atht you require.
________________________________________________________________________________________________
Regards
Steve
SQL 2008 DBA/DBD - MCTS/MCITP
Please don't trust me, test the solutions I give you before using them.
April 9, 2013 at 3:35 pm
Either that or bloat your tables with computed columns to represent the columns you want in your queries.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply