This script will give the text of all the procedures with occurences of a specifc variable. Syscomments has a limitation of 4000 characters but this script overcomes that as it uses DMO. The output is generated in a text file. If you want the name of the procedure only. replace the line where it says output.writeline (storedprocedure.text) to output.writeline(storedprocedure.name).Its the fourth line from the end of the file.
Below are the steps for deployment
1) Copy the script below in a text file.
2) Save it as find_procedure.vbs
3) Open a command prompt and browse to the directory where the script is located.
4) It takes servername, uid, password, databasename and variable as the input parameters. Separate each value with a space. You can use double quotes for variables with space.
e.g. find_procedure.vbs server_name uid password database variable
5) The output of the script is generated in the file output.txt
Display only windows logins for SQL Server