tags:

views:

20

answers:

1

Hi all, I need a stored procedure to search for a string in any database in a database server. For Eg there are 5 databases in a database server and i want to search for string "sooraj" in all tables of all databases in that server. Kindly let me know if this is possible.

Thanks Sooraj

+1  A: 

Several database servers allow to define an "alias" which points to another database. So what you could do:

  1. Create aliases for all databases in one server
  2. Get a list of all relevant tables in your stored procedure
  3. Search the tables
Aaron Digulla