Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

How best to search a DB for ALL instances of a variable?

How best to search a DB for ALL instances of a variable?


I have queries which return all Columns in a Table and a second query to return all Columns on the Server.


I also need to find all instances of a variable name in every table and stored procedure.


What tools can do this? 


Is there a query which can do this? I already can query the Table. How about a query which can see inside the stored procedures?


I recall a tool from Red Hat which did this...


Suggestions?


Thanks.

ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Scott: variable can appear in a table if you are storing SQL scripts (for whatever reason) in table columns. This usage of variables is not obvious but possible.
Oh, OK, then you do it as above.  (I was thinking of a table as being CREATE TABLE / table definition, which afaik doesn't allow any variables to appear.)