Solved

query only user procs in sql 2000

Posted on 2011-03-08
5
227 Views
Last Modified: 2012-05-11
how can you filter for user created procs in sql 2000?
0
Comment
Question by:anushahanna
  • 3
5 Comments
 
LVL 6

Author Comment

by:anushahanna
ID: 35077228
the query i have is

select name from syscomments a,sysobjects b where a.id = b.id and xtype = 'p' and text like '%something%'
and it brings a lot of records, more than what we created (duplicates too)
0
 
LVL 32

Assisted Solution

by:ewangoya
ewangoya earned 175 total points
ID: 35079051

this is much cleaner

select ROUTINE_NAME
from INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_NAME LIKE '%something%
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35082506
most procs will be more than 4000 char- so i thought of using syscomments..
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 325 total points
ID: 35082821
your query brings duplicates, because when a stored procedure is, when longer, "split" into several rows in syscomments... and if several part are matching ...

apart from that, there is no "system" stored procedure flag, so you cannot "filter" for such things.

select name 
from syscomments a,sysobjects b where a.id = b.id and xtype = 'p' and text like '%something%'
group by name

Open in new window

0
 
LVL 6

Author Comment

by:anushahanna
ID: 35083670
thanks for confirming.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

861 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