Solved

best system table to search code

Posted on 2011-03-08
9
265 Views
Last Modified: 2012-05-11
what is the best system table in 2000 and 2005+ to search for specific text in a code (UDF or proc) etc

thanks
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
  • 3
  • 3
9 Comments
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 250 total points
ID: 35073404

SELECT ROUTINE_NAME
FROM INFORMATION_SCHEMA.ROUTINES
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35073616
OK-

I guess in 2000, that is the only option, right?

what about in 2005 & 2008?
0
 
LVL 40

Assisted Solution

by:lcohan
lcohan earned 250 total points
ID: 35073665
Always and all versions I use:

usemydb
go
select * from sys.syscomments where text like '%something%'
go

this will return ALL unencrypted SQL code objects containing "something"
0
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 
LVL 6

Author Comment

by:anushahanna
ID: 35073716
good point - INFORMATION_SCHEMA.ROUTINES also will work on all versions, right?
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35073729
correct, INFORMATION_SCHEMA.ROUTINES for all versions
0
 
LVL 40

Expert Comment

by:lcohan
ID: 35073845
"Returns the first 4000 characters of the definition text of the function or stored procedure if the function or stored procedure is not encrypted. Otherwise, returns NULL."

http://msdn.microsoft.com/en-us/library/ms188757%28SQL.90%29.aspx

Where do you get the Views and Triggers code from?
As far as I'm aware they are ALL in sys.syscomments.text column

0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35074066

@icohan
What are you talking about?

This question is about UDFs and Stored Procedures
0
 
LVL 40

Expert Comment

by:lcohan
ID: 35074170
Right - my bad...overlooked that and thought is ALL sql code objects.
Please disregard my answer.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35077209
thanks to both of you!
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.

691 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