Link to home
Start Free TrialLog in
Avatar of countrymeister
countrymeister

asked on

How can I find all stored procedures that have a following text - User does not have access

I am using SQL Server 2005, I need to find all procs which have the following string text in the procs

User does not have access

I am getting this message when I run a bat file, whcih calss a procs which in turn calls many other procs
Is there any way I can find this with a query
Avatar of jamesgu
jamesgu

select * from information_schema.routines where routine_type = 'PROCEDURE' and
Left(Routine_Name, 3) NOT IN ('sp_', 'xp_', 'ms_')
and routine_definition like '%User does not have access%'

Avatar of countrymeister

ASKER

It gives me foill error, my mistake, I am using sql 2000 and not 2005
Msg 208, Level 16, State 1, Line 1
Invalid object name 'information_schema.routines'.
the statement works for sql server 2000 as well

what do you get if you run

sp_helptext <with_a_stored_proc_name_here>
ASKER CERTIFIED SOLUTION
Avatar of jamesgu
jamesgu

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