SQL2005: Searching across all databases

~J~

~J~

Soldato
Joined
20 Oct 2003
Posts
7,558
Location
London
Anyone know of a stored procedure or piece of script that will allow me to search across EVERY database and the tables within it, for a simple bit of text?

We've just migrated about 100 databases onto a server, each database has about 50-60 tables, each table has about 30-40 fields.

These database date back from last week to 2002 and we've just discovered that back in 2004 there was a SQL injection and need to remove the offended 'crap'.

Just a dead easy bit of text, but want to go through EVERYTHING to see where it is!

Any thoughts?
 
When I had to clear out some old crap from a DB that had been injected I used this - although it only works at table column level, not database level so may not be entirely what you're after, but I can guarantee it works well.
 
Glad I could help :)

It's a really good tool - it saves writing lots of SQL and gets around the 4,000 character limit on the native replace function which can really ruin your day when you've got lots of text fields to deal with.
 
Back
Top Bottom