Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

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

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
tesla764
Asked:
tesla764
3 Solutions
 
5teveoCommented:
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
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
>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
 
Simone BSenior E-Commerce AnalystCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now