• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

How do I find the table SQL stored new data to.

Can anyone share a script that can help me locate the table in my database that holds a column named Pinto ?
0
GD_GRAY
Asked:
GD_GRAY
3 Solutions
 
Scott PletcherSenior DBACommented:
USE <db_name>

SELECT OBJECT_NAME(object_id), *
FROM sys.tables
WHERE name = N'Pinto'
0
 
ralmadaCommented:
try

select OBJECT_NAME(object_id)
from sys.columns
where name = N'Pinto'
0
 
ZberteocCommented:
select TABLE_NAME from information.schema.columns where COLUMN_NAME='Pinto'
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Éric MoreauSenior .Net ConsultantCommented:
If you want to search wider then just columns in tables (for example which SP use it?), check http://www.red-gate.com/products/sql-development/sql-search/
0
 
Scott PletcherSenior DBACommented:
CORRECTION: I meant "sys.columns" instead of "sys.tables":


USE <db_name>

SELECT OBJECT_NAME(object_id), *
FROM sys.columns
WHERE name = N'Pinto'
0
 
GD_GRAYAuthor Commented:
I guess the column insert into the data base must add some sort of prefix to the column ID. Im not able to find it in the data base at all. How about a way to search the full data base for a unique value that would be found in that same table and column. Do you happen to know how to do that ?
0
 
GD_GRAYAuthor Commented:
I found a script to do what I need. Thanks
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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