Solved

query only user procs in sql 2000

Posted on 2011-03-08
5
229 Views
Last Modified: 2012-05-11
how can you filter for user created procs in sql 2000?
0
Comment
Question by:anushahanna
[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
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:Ephraim Wangoya
Ephraim Wangoya 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

734 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