is there a select query where I can find a column that has a data named 'Hello'. I'm not looking for a data on a single table, but am looking for a data on a whole database.
Asked
Active
Viewed 283 times
-2
-
*Dynamic SQL* might help you with this. Also query information schema to get all column names. – John Woo Feb 20 '13 at 07:26
-
1See here: http://stackoverflow.com/q/12051216/330315 and here http://stackoverflow.com/q/13514509/330315 and here: http://stackoverflow.com/q/1289792/330315 and here: http://stackoverflow.com/search?q=search+all+columns+in+a+database – Feb 20 '13 at 07:36
1 Answers
1
@aedz: here are some suggenstions/hints for you, basically this is easy to google:
MSSQL:
- SQL Server: Search all tables for a particular GUID
- http://gallery.technet.microsoft.com/scriptcenter/c0c57332-8624-48c0-b4c3-5b31fe641c58
- http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm
- Search for a string in all tables, rows and columns of a DB
- http://justgeeks.blogspot.de/2006/10/search-ms-sql-server-for-any-text.html
- http://www.sqlservercentral.com/Forums/Topic419243-8-1.aspx
- http://www.mssqltips.com/sqlservertip/1522/searching-and-finding-a-string-value-in-all-columns-in-a-sql-server-table/
- http://www.mssqltips.com/sqlservertip/1555/sql-server-find-and-replace-values-in-all-tables-and-all-text-columns/
MySql:
- Search for all occurrences of a string in a mysql database
- Search in all fields from every table of a MySQL database
- MySQL tool that searches for a string in all fields, tables and databases
- mySQL query to search all tables within a database for a string?
- http://kedar.nitty-witty.com/blog/search-through-all-databases-tables-columns-in-mysql