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
 General SQL Server Forums
 New to SQL Server Programming
 How to select a colum if its table name was unkno

Author  Topic 

prajeesh.prathapan
Starting Member

1 Post

Posted - 2010-07-30 : 07:13:56
hi,
From SQL Server i want to select a column from particular table. but i don't know the Table name.I know only the column name. in this case how i will write query to retrieve data from that particular column

please help me with required information
Prajeesh

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-07-30 : 07:15:06
find out the table name using this

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'xxx'



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -