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

searching for columns

Status
Not open for further replies.

rq

Programmer
Jun 13, 2002
56
0
0
US

I'm in the process of integrating 2 apps that use SQL Server 2000. Is there a function or stored procedure that can tell me if a column name is used in another table? E.g., the purchase order id exists in the sales history table; I would like to know if this column name is referred to in another table.
 
How can you access syscolumns?
 
This is the way I did it through Query Analyzer

SELECT NAME FROM Database#1.DBO.SYSOBJECTS DS WHERE DS.NAME NOT IN
(SELECT NAME FROM Database#2.DBO.SYSOBJECTS)
AND DS.XTYPE='U'

Thanks
Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top