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

Posted on 2013-01-18
Last Modified: 2013-01-18
Can anyone share a script that can help me locate the table in my database that holds a column named Pinto ?
Question by:GD_GRAY
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
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 334 total points
ID: 38793836
USE <db_name>

SELECT OBJECT_NAME(object_id), *
FROM sys.tables
WHERE name = N'Pinto'
LVL 41

Assisted Solution

ralmada earned 166 total points
ID: 38793846

select OBJECT_NAME(object_id)
from sys.columns
where name = N'Pinto'
LVL 26

Expert Comment

ID: 38793926
select TABLE_NAME from information.schema.columns where COLUMN_NAME='Pinto'
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

LVL 70

Expert Comment

by:Éric Moreau
ID: 38794035
If you want to search wider then just columns in tables (for example which SP use it?), check
LVL 69

Accepted Solution

Scott Pletcher earned 334 total points
ID: 38794332
CORRECTION: I meant "sys.columns" instead of "sys.tables":

USE <db_name>

SELECT OBJECT_NAME(object_id), *
FROM sys.columns
WHERE name = N'Pinto'

Author Comment

ID: 38794630
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 ?

Author Closing Comment

ID: 38794732
I found a script to do what I need. Thanks

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.

730 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