Nice script.
A couple of questions for you:
- Shouldn't there be a set of [ ] around the variables in case they contain special characters like blanks or SQL keywords?
- How can you handle special characters in the LIKE comparison if a string you would search for has a %, _, [ ], [^ ] or quotes?
Toni