Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Query every column in every table

Author  Topic 

pr4t3ekd
Starting Member

31 Posts

Posted - 2010-10-21 : 01:27:43
Hi,

I would like to query every column in every table for a specific value.

The value i am looking for: LIKE '%TEST%'.

I would like the result to show me as follows:-

Table Name | Column Name | Number of Records


Hope you can help.

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2010-10-21 : 07:59:16
http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

disclaimer: i have never used this or needed to use something like this. recommend not to ever run on a production server!!!


elsasoft.org
Go to Top of Page

pr4t3ekd
Starting Member

31 Posts

Posted - 2010-10-21 : 18:19:46
Yeah i'm running this on a test evironment. Thanks for that.

Also, i wonder if this code is readily available in Oracle SQL?
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2010-10-21 : 20:39:33
you could do something very similar in oracle with knowledge of their system catalog tables.


elsasoft.org
Go to Top of Page
   

- Advertisement -