Important alert: (current site time 7/15/2013 6:56:02 PM EDT)
 

article

Quick Column Find

Email
Submitted on: 7/8/2004 12:19:47 PM
By: Rob Waibel  
Level: Beginner
User Rating: By 6 Users
Compatibility: SQL Server 2000, SQL Server 7.0
Views: 20492
author picture
(About the author)
 
     Quickly find all tables/views that have a specific column name

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
				Drop Proc FindAllColumns 
GO
Create Proc FindAllColumns
 @ColName VarChar(255)
AS
 Select SO.Name From SysColumns SC
Inner Join SysObjects SO on SO.ID = SC.ID
Where SC.name = @ColName


Other 11 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
7/9/2004 11:40:13 AMSolart

good job
(If this comment was disrespectful, please report it.)

 
8/7/2004 7:41:07 AMRajesh Sivaraman

Actually I was looking for something like this which will display all the table names when we give the field name.
Wonderful work. Keep it going.

Regards
Rajesh Sivaraman
(If this comment was disrespectful, please report it.)

 
8/10/2006 6:17:32 PMJason

Thanks so much - this helped me out a bunch!
(If this comment was disrespectful, please report it.)

 
8/30/2006 5:02:22 PMIng. Juarez

great script, pointed me in the right direction! I changed it a bit in order to search for incomplete names, here is the mod., it might be helpful. "Select SO.Name as TableName, SC.name as ColumnName From SysColumns SC Inner Join SysObjects SO on SO.ID = SC.ID Where lower(SC.name) LIKE %'+lower(@ColName)+'%' Order By TableName"
(If this comment was disrespectful, please report it.)

 
9/12/2007 2:37:14 AMADI

EXCELLENT !
(If this comment was disrespectful, please report it.)

 
5/2/2009 3:56:07 PMCalvin

Thanks...
Very Helpfull
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.