?
Solved

Finding a Field

Posted on 2011-02-21
3
Medium Priority
?
481 Views
Last Modified: 2013-11-05
I'm sure this is a long shot, but I'll ask anyway.

I have a database that contains roughly 400 tables, and probably a similar amount of views.

Some where in all that, there is a field I'm looking for with a name that contains the word "Applied" (Might be Applied_Total or Applied_Sum or other some such).  Now, I could take the next two or three hours and look at the field listing of each table and view and try and find out which one(s) I'm looking for, but that is way too tedius.

Is there any way to find out which tables (and maybe views) which contain the fields which contain the word "Applied"?
0
Comment
Question by:Clif
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Accepted Solution

by:
s_chilkury earned 2000 total points
ID: 34945448
SELECT table_name=sysobjects.name,
         column_name=syscolumns.name,
         datatype=systypes.name,
         length=syscolumns.length
    FROM sysobjects
    JOIN syscolumns ON sysobjects.id = syscolumns.id
    JOIN systypes ON syscolumns.xtype=systypes.xtype
   WHERE sysobjects.xtype='U'
            AND syscolumns.name LIKE '%Applied%'
ORDER BY sysobjects.name,syscolumns.colid

OR

SELECT name FROM sysobjects WHERE id IN ( SELECT id FROM syscolumns WHERE name LIKE '%Applied%' ) ORDER BY name
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 34945531

select sys.objects.name as [Table name], sys.columns.name as [Column]
from sys.columns
inner join sys.objects ON sys.objects.object_id = sys.columns.object_id
where type = 'U'
and sys.columns.name like '%Applied%'
0
 
LVL 10

Author Closing Comment

by:Clif
ID: 34945647
That was perfect.

To tell you the truth, I was sure I was going to get a reply that it couln't be done.

Thank.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question