Avatar of curiouswebster
curiouswebster
Flag 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.

Microsoft SQL Server

Avatar of undefined
Last Comment
Scott Pletcher

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scott Pletcher

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
David Favor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Pavel Celba

@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.
Scott Pletcher

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.)
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23