all groups > sql server (microsoft) > july 2006 >
You're in the

sql server (microsoft)

group:

get Columns used in FROM clause


get Columns used in FROM clause wasco77
7/17/2006 10:36:39 AM
sql server (microsoft): Hi all,
anyone know how can I get the name of the only columns used in clause
from?
ex:

----------------------------
create view web_1_Pagine as
select tl.id as idtipologico, p.idpagina
from WEB_Pagine p left join WEB_REL_PagineLocTL ip on
(p.idpagina=ip.idpagina)
left join Localita l on
(ip.idlocalita = l.idLocalita)
left join TIPILOGICI_IMPIANTO tl on
(ip.idtipologico = tl.ID )
go
------------------------------
I need getting the column's name used in from clause, and in join then.
I would get:

WEB_Pagine - idpagina
WEB_REL_PagineLocTL - idpagina
Localita - idLocalita
WEB_REL_PagineLocTL - idLocalita
TIPILOGICI_IMPIANTO - ID
WEB_REL_PagineLocTL - idtipologico

My max result it was to get the all columns used in view (in select
clause and in from clause...)

thanks a lot

Walter
Re: get Columns used in FROM clause Damon
7/19/2006 3:30:20 PM

[quoted text, click to view]


I'm not sure if this is what you want but this is what you asked for.

create view web_1_Pagine as
select p.idpagina, ip.idpagina, l.idLocalita, ip.idlocalita, tl.ID,
ip.idtipologico
from WEB_Pagine p left join WEB_REL_PagineLocTL ip on
(p.idpagina=ip.idpagina)
left join Localita l on
(ip.idlocalita = l.idLocalita)
left join TIPILOGICI_IMPIANTO tl on
(ip.idtipologico = tl.ID )
go

Damon.
AddThis Social Bookmark Button