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 2005 Forums
 Transact-SQL (2005)
 Sql Query required.

Author  Topic 

Srain
Starting Member

23 Posts

Posted - 2009-06-25 : 20:37:23
Hi,

please let me know how to find a particular attribute(field name) belongs to which table in the database.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-06-25 : 21:25:41
use INFORMATION_SCHEMA.COLUMNS


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

Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-06-26 : 00:45:02
also use this
select object_name(object_id),name from sys.columns
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-26 : 14:11:37
[code]select TABLE_NAME from INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='Your column'[/code]
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-26 : 16:09:02
If you are searching for field name and don't know the exact name:
WHERE COLUMN_NAME like '%Your_column%'


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -