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

Posted on 2008-10-22
Medium Priority
Last Modified: 2012-05-05
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
Question by:countrymeister
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3

Expert Comment

ID: 22779890
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%'


Author Comment

ID: 22780136
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'.

Expert Comment

ID: 22780190
the statement works for sql server 2000 as well

what do you get if you run

sp_helptext <with_a_stored_proc_name_here>

Accepted Solution

jamesgu earned 2000 total points
ID: 22780262
or try this

select top 10 object_name(b.id) from sysobjects a, syscomments b where a.id = b.id and a.xtype = 'P' and b.text like '%User does not have access%'

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question