Jun 20, 2002 #1 btturner Programmer Joined May 17, 2001 Messages 175 Location US fyi, I need to identify all tables in my Prod DB which use column "CUST_ID" Can you please help me w/ a query... which will identify all SQL Server 2k tables (in a single database) which use this column name? thanks!
fyi, I need to identify all tables in my Prod DB which use column "CUST_ID" Can you please help me w/ a query... which will identify all SQL Server 2k tables (in a single database) which use this column name? thanks!
Jun 20, 2002 1 #2 tlbroadbent MIS Joined Mar 16, 2001 Messages 9,982 Location US Select * From information_schema.columns Where column_name='cust_id' Terry L. Broadbent - DBA Computing Links: http://tlbroadbent.home.attbi.com/prog.htm faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions. Upvote 0 Downvote
Select * From information_schema.columns Where column_name='cust_id' Terry L. Broadbent - DBA Computing Links: http://tlbroadbent.home.attbi.com/prog.htm faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
Jun 20, 2002 #3 Grimey Programmer Joined Apr 30, 2002 Messages 2 Location GB This works for me in SQL7... USE ProdDB SELECT C.Name, T.Name FROM syscolumns C INNER JOIN sysobjects T ON C.id = T.id WHERE C.name='CUST_ID' HTH, Grimey Upvote 0 Downvote
This works for me in SQL7... USE ProdDB SELECT C.Name, T.Name FROM syscolumns C INNER JOIN sysobjects T ON C.id = T.id WHERE C.name='CUST_ID' HTH, Grimey