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 27

Expert Comment

ID: 38793926
select TABLE_NAME from information.schema.columns where COLUMN_NAME='Pinto'
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

695 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