Searching a string

Searching in the haystack. Creadits Perry McKenna

I recently had to do a work which was easy but required to be done faster. I had to find all the occurrences of a particular text string which could have been stored  any column of any table in any user databases of all the servers. I already had a script which would create a stored procedure named "SearchAllTables". You can create this stored procedure in any database you want and call it from the database you want to search in that instance. Say if you have created this stored procedure in master database and want to search in database named "model" you have to execute following after creating the stored procedure:


But here as I said we had to search all the user databases of every SQL Server instance. So I modified the create store procedure script in such a way that you have to execute is just once on a SQL server instance OR you can execute it on a group of registered servers in your management studio if you want. Note that it would take quite long. Following is the script:


Make Money from Surveys

Popular posts from this blog

The current master key cannot be decrypted

Schema.Object has an unresolved reference to Schema

Remove dateModified related warning appearing during Structured data testing