September 21, 2011 at 4:49 am
Get the all column and table name from sql query
for example
select emp_id, emp_name ,d.department_id
from Emp e inner join department d on d.department_id=e.department_id
where emp_id=10
Output like
Column name table name
emp_id emp
emp_name emp
depatment_name emp/department
Regards
Srikant
September 21, 2011 at 4:57 am
When, how & why do you want to do this?
September 21, 2011 at 5:00 am
We just want to know the how many column and table used in sql select stament
September 21, 2011 at 5:03 am
From where? In what fron end?
September 21, 2011 at 5:07 am
The INFORMATION_SCHEMA views should give you all the information you need.
September 21, 2011 at 5:10 am
steveb. (9/21/2011)
The INFORMATION_SCHEMA views should give you all the information you need.
Not for a specific select statement that is not in a view.
September 21, 2011 at 6:02 am
Ninja's_RGR'us (9/21/2011)
steveb. (9/21/2011)
The INFORMATION_SCHEMA views should give you all the information you need.Not for a specific select statement that is not in a view.
No not directly obviously, but it could be used as part of the query as a sub-query or similar to retrieve the information.
but for what purpose , who knows?
September 21, 2011 at 6:27 am
you could get it from the execution plan, if it was in the cache.
it's not easy, as xQuery's a little difficult, but it's in there.
Lowell
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply