/* */ Searching across your SQL Server Part 2 |SQL Works

Monday, October 1, 2012

Searching across your SQL Server Part 2

Click here for the first part of this post

As a continuation of my previous post on searching your SQL Server databases, below is a new and more efficient version of the search script. It allows you to customize the output in the SELECT statement from the results table before you run it to save extra querying after the results are created. The cursor has been eliminated in favor of a WHILE loop, and this could easily be converted to a stored procedure if you wanted to have it live on your server and be called by an application or other users. Of course there are probably small improvements that could be made, maybe I will explore some in the future, but you came here to get back to work and this script works.




Continue reading Part 3 - Converting this script into a stored procedure