[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
É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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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