Solved

query only user procs in sql 2000

Posted on 2011-03-08
5
226 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 142

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
get column names from table in vb.net 8 26
Run SQL Server Proc from Access 11 27
SQL Improvement  ( Speed) 14 26
Insert query into temp tables using Coldfusion 3 12
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…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

813 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

12 Experts available now in Live!

Get 1:1 Help Now