Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

query only user procs in sql 2000

how can you filter for user created procs in sql 2000?
0
anushahanna
Asked:
anushahanna
  • 3
2 Solutions
 
anushahannaAuthor Commented:
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
 
Ephraim WangoyaCommented:

this is much cleaner

select ROUTINE_NAME
from INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_NAME LIKE '%something%
0
 
anushahannaAuthor Commented:
most procs will be more than 4000 char- so i thought of using syscomments..
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
anushahannaAuthor Commented:
thanks for confirming.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now