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
 Name of field and tables

Author  Topic 

Sep410
Posting Yak Master

117 Posts

Posted - 2008-06-24 : 16:09:04
Hi,
I only have value of some fields in an old database.How can I find the name of the fiels and name of the table which contains that field?

Thanks,

Sep

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-24 : 16:27:31
Use the INFORMATION_SCHEMA views.

SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'SomeColumn'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Sep410
Posting Yak Master

117 Posts

Posted - 2008-06-24 : 16:48:32
I don't know the column_name. the only thing I know is some of the records from that database.

Actually I am looking for column’s name and table’s name.
Sep
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-24 : 16:52:45
Don't you see column names while viewing data? Where did you get data from?
Go to Top of Page

Sep410
Posting Yak Master

117 Posts

Posted - 2008-06-24 : 16:56:17

I have a report as a document and an old database with 20 tables. Tables don’t have any f_keys. I should figure out how did they create this report before and which tables are involved in this reports.


Sep
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-24 : 17:13:30
http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Sep410
Posting Yak Master

117 Posts

Posted - 2008-06-24 : 17:17:23
Thanks Tara.

Sep
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-24 : 21:02:54
quote:
Originally posted by tkizer

http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog




That was a good one.
Go to Top of Page
   

- Advertisement -