views:

43

answers:

3

i want to search all teh fields in my DB to find the field names that have in them a string that contains some text.

im trying to find a table and field responsible for some 3rd party software actions that i am aonly able to see the values for. i want to use these values to find the table and field they are stored in.

+1  A: 

This may help you:

http://blog.sqlauthority.com/2008/08/05/sql-server-2005-get-field-name-and-type-of-database-table/

Nissan Fan
Google is our friend :-)
Luc M
A: 

I don't have specific answer. But i use PHP code for MySQL that calls "show tables" and then for each table calls "show create table [table_name]" I export the result to a text file and then search it...

aviv
+2  A: 

like this

select column_name,table_name
 from information_schema.columns
where column_name like '%text%'

Misunderstood your question, see here: Search all columns in all the tables in a database for a specific value

SQLMenace
i dont care what the clounm name is i want the names of the columns that have a certain string od data with in records or data points of the coloumn. more like this:select Col_Name where Col_Name.data = 'sometext'i dont want fields called sometext... i want the records of the tables that have sometext to report to me the names of the fields that have this data.
kacalapy
In that case see here: http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/the-ten-most-asked-sql-server-questions--1#2
SQLMenace