|
| 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 |
|
(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...
- 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.
- 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.
- You may link to this article from another website, but ONLY if it is not wrapped in a frame.
- 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
|
Your Vote
|
| |
Other User Comments
|
7/9/2004 11:40:13 AM: Solart
good job (If this comment was disrespectful, please report it.)
|
8/7/2004 7:41:07 AM: Rajesh 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 PM: Jason
Thanks so much - this helped me out a bunch! (If this comment was disrespectful, please report it.)
|
8/30/2006 5:02:22 PM: Ing. 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 AM: ADI
EXCELLENT ! (If this comment was disrespectful, please report it.)
|
5/2/2009 3:56:07 PM: Calvin
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.
|