Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2947
  • Last Modified:

how to see original table name after alias in query

hey guys, in my queries i use aliases to name my tables / sub queries. i do this by going to the property pane (pressing F4) and then type in the name i want in the Alias field.

however sometimes i want to see which table / sub query i'm using in that query and i don't know what's the name by just looking at the alias. so i need to see the original table name.

Question: how do i see the original table / sub query name?

the only way i know how to do it is to go to SQL design mode and read from the SQL. surely there is a better way right? thanks in advance guys! = )
0
developingprogrammer
Asked:
developingprogrammer
  • 6
  • 2
  • 2
  • +1
4 Solutions
 
PatHartmanCommented:
Nope.  Open the SQL view.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
This is a way (see image below)
Turn on Object Dependencies on the Database Tools ribbon.
Open the Object Dependencies dialog.
Then, with the query opened or closed, select the query in the Navigation pane.
In the OD dialog,  select "Objects that I depend on"
This will show your actual Table

Alias
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Important side note:
When you enable Object Dependencies, this turns on Name AutoCorrectOptions>> Track Name AutoCorrect info. However, there are some know issues with having NAC on - ESPECIALLY if Perform name AutoCorrect is also checked (bad, bad, bad, no no no). Fortunately, OD does not force this setting on.
Allen Browne lists the issues on his site.

So ... you may not want to leave this on indefinitely - especially if the db is deployed, because NAC Options are 'Current Database' options, and thus go WITH the db - where ever it may end up.

mx
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Gustav BrockCIOCommented:
For that same reason I never use alias in Access SQL (except, of course, where they are a must).

/gustav
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
When is it a must ?
0
 
Gustav BrockCIOCommented:
When you link to the same table twice or to itself.

/gustav
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
:-)
0
 
developingprogrammerAuthor Commented:
whao Joe, i never knew about the object dependencies pane! it is really so so powerful! i can just think of so many ways it will help me / i can use it now = ))

thanks gustav for pointing out when to use Alias and thanks Pat too for your help and sharing! = )
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Not a big deal, but ... I'm a tad confused. The answer
"Nope.  Open the SQL view."
... is well, just wrong :-(

mx
0
 
developingprogrammerAuthor Commented:
hrmm i think Pat was trying to say other than object dependencies, there is no way to see the full table name in the design window. the object dependencies window is kinda like a separate super charged thing ha = )
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
seems like a stretch.
Nope = No :-(
She made no mention of the OD window.
0
 
PatHartmanCommented:
You could also look in MSysQueries but I was under the impression the OP wanted something convenient.  I haven't spent any time analyzing the format of MSysQueries but it looks like Name1 is the table/query name and Name2 is the Alias.

You could create your own query/table cross reference without having to turn on name autocorrect by using MSysQueries.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 6
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now