Solved

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

Posted on 2008-10-22
4
213 Views
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
0
Comment
Question by:countrymeister
[X]
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
4 Comments
 
LVL 9

Expert Comment

by:jamesgu
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%'

0
 
LVL 1

Author Comment

by:countrymeister
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'.
0
 
LVL 9

Expert Comment

by:jamesgu
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>
0
 
LVL 9

Accepted Solution

by:
jamesgu earned 500 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%'
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

737 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