July 23, 2008 at 10:04 am
Seems like a question that I shouldn't even be asking but it was posed to me by our BI group and was something I really had never even thought about. Can you assign a global alias to a table? I cannot find anything to point me to answer yes but thought I'd put it out there for responses. This has come about because of the following scenario:
Application team released a new version of the application. HOWEVER, it appears either someone did not check the latest source code into VSS after the prior release or checked in an old copy. Either way, an older version of code was used for the most recent release. That code points to a table that no longer exists. We can create a view using the original table name to allow the app to continue to function until they can resolve their code issue but.....
Again, BI asked if there is such a thing as a global variable and, as I didn't know, I've kicked off a little research (found nothing yet and truly don't expect to). Any input would be appreciated.
-- You can't be late until you show up.
July 23, 2008 at 12:38 pm
I am not sure if I have understood your question correctly. But i think can use SYNONYM for the table.
Create SYNONYM Newtable
FOR [database].[owner].OldTable
select * from Newtable
Thanks
Dev.
July 23, 2008 at 12:42 pm
Oops..!!! It works only for 2005.:w00t:
July 23, 2008 at 12:46 pm
Wasn't sure if I was clear enough...There are multiple references with the Jave code to a table that no longer exists and I'm wondering if there is a way at the server level to define an alias so that any reference to the new table name finds the alias, i.e. tablenew is the new table but in the code it is tableold. Can I do something like I would in sql and define an alias so that ANY call to the old file name (as the alias) would indeed hit the new file? Again, I believe the answer is no but I'm not always right!
Edit:
Dev (7/23/2008)
Oops..!!! It works only for 2005.:w00t:
- That's what I thought.
-- You can't be late until you show up.
July 23, 2008 at 2:53 pm
tosscrosby (7/23/2008)
Wasn't sure if I was clear enough...There are multiple references with the Jave code to a table that no longer exists and I'm wondering if there is a way at the server level to define an alias so that any reference to the new table name finds the alias, i.e. tablenew is the new table but in the code it is tableold. Can I do something like I would in sql and define an alias so that ANY call to the old file name (as the alias) would indeed hit the new file? Again, I believe the answer is no but I'm not always right!
Yes. This is one of the big reasons why SQL, in its infinite wisdom has Views.
And I assume that you mean "table" and not "file" and that you mean "database level" and not "server level".
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
July 23, 2008 at 3:22 pm
rbarryyoung (7/23/2008)
Yes. This is one of the big reasons why SQL, in its infinite wisdom has Views.
And I assume that you mean "table" and not "file" and that you mean "database level" and not "server level".
Yes, tables not files (the table name is [claim file], plus, years ago I worked on an AS400 and everything was a file...) and yes, database level. Thanks for the correction and the confirmation.
-- You can't be late until you show up.
July 23, 2008 at 3:39 pm
Glad I could help.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply