Solved

Is there a way to check all table columns in a database for a certain field.

Posted on 2014-02-18
3
301 Views
Last Modified: 2014-02-18
The database name is "rpr_dev" and the field I want to find is called "zoneword". I'd like to know which table is that field in.
Thanks in advance
0
Comment
Question by:tesla764
[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 8

Assisted Solution

by:5teveo
5teveo earned 125 total points
ID: 39868491
SELECT c.name AS ColName, t.name AS TableName
FROM sys.columns c
    JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%MyName%'
0
 
LVL 66

Assisted Solution

by:Jim Horn
Jim Horn earned 75 total points
ID: 39868502
>Is there a way to check all table columns in a database for a certain field.
Define 'field'.  Value in a column for a given row, column name, ...
0
 
LVL 11

Accepted Solution

by:
Simone B earned 300 total points
ID: 39868512
Try this:

USE rpr_dev
go

SELECT a.[name] as ColumnName, b.[name] as TableName FROM sys.columns a
INNER JOIN sys.tables b ON a.object_id = b.object_id
WHERE a.[name] = 'zoneword'

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

728 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