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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding a field

Status
Not open for further replies.

markSaunders

Programmer
Joined
Jun 23, 2000
Messages
196
Location
GB
what is the best method of locating the tables in which a specific field is the primart key?

i'm trying to analyse a db passed to me and i have a field, say xID, and need to check in which tables it is used.

thanks
m Mark Saunders :-)
 
This will search all tables and views.

Select * From information_schema.columns
Where column_name='xID'

You can search stored procedures by searching the syscomments table.

Select * From syscomments
Where text like '%xID%'

A couple of stored procedures have been developed and uploaded on SWYNK.com. You can find them on this page.


Download findText.sql and/or WhereAmI.sql. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
thanks for that - just the ticket!
mark Mark Saunders :-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top