Solved

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

Posted on 2013-01-18
7
203 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 69

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

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…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now