Solved

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

Posted on 2013-01-18
7
204 Views
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 ?
0
Comment
Question by:GD_GRAY
7 Comments
 
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'
0
 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 166 total points
ID: 38793846
try

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

Expert Comment

by:Zberteoc
ID: 38793926
select TABLE_NAME from information.schema.columns where COLUMN_NAME='Pinto'
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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 http://www.red-gate.com/products/sql-development/sql-search/
0
 
LVL 69

Accepted Solution

by:
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'
0
 

Author Comment

by:GD_GRAY
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 ?
0
 

Author Closing Comment

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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 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