Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find a which table a field is in ?

Status
Not open for further replies.

Jamie2002

Technical User
Sep 17, 2001
62
0
0
GB
Using SQL 6.5 how do I find which table a field is in if I have the field name ??

Also how do I list all tables and fields in the database, security levels is not an issue as we have no security or administrators set-up what-so-ever.


Thanks Thanks

Jamie
 
Hi

This should return all the tables when a column is specified:

select so.name
from sysobjects so, syscolumns sc
where so.id = sc.id
and sc.name = 'req_no'

This will return the table names and it's columns:

select so.name, sc.name
from sysobjects so, syscolumns sc
where so.id = sc.id

Hope it helps

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top