Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Issue: Table with Columns from Joined Tables

Author  Topic 

vijay1234
Starting Member

48 Posts

Posted - 2014-09-04 : 04:11:03
Hi friends,

I have table A which is actually built on joining various tables say table B, C, D, X,Y etc.
The columns of table A are from the joined tables.

I just wanted to have list like this-

column1 of table A - from table B
column2 of table A -from table C
column 3 of table A -derived from table D and X.
.
.
.
.etc


Any Approach as the query is very big as it has got 150 tables to do such a way.

Thanks in Advance

Vijay

Muj9
Yak Posting Veteran

75 Posts

Posted - 2014-09-04 : 06:16:26
The obvious way would be to give the columns alias names one by one but as you say it contains 150+ tables then would be a pain.


select * from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME = ''
Go to Top of Page

vijay1234
Starting Member

48 Posts

Posted - 2014-09-04 : 06:25:51
Hi Scot,

Can you be more specific.

Vijay
Go to Top of Page
   

- Advertisement -