Add new comment

Submitted by CyCo on Wed, 22/04/2015 - 10:20

In reply to by Jochus

Not that easy in SQL Server idd :(
Best solution would probably be to use a third party tool, like ApexSQL Search (free).

Your script should work, but it will be very slow when running it for a large database.

I did a quick Google search and found you probably got your script from here:
stackoverflow dot com slash questions slash 591853 slash search-for-a-string-in-all-tables-rows-and-columns-of-a-db

The comments in the answer also say it will be "RIDICULOUSLY slow" :)

The answer below that also suggests ApexSQL, or use a script with temporary tables instead of cursors, which will increase the speed significantly.

The content of this field is kept private and will not be shown publicly.


  • Lines and paragraphs break automatically.
  • You can caption images (data-caption="Text"), but also videos, blockquotes, and so on.
  • Web page addresses and email addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <cpp>, <css>, <html5>, <java>, <javascript>, <php>, <sql>, <xml>. The supported tag styles are: <foo>, [foo].
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.