Solved

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

Posted on 2008-10-22
4
187 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
  • 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now