Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

best system table to search code

Posted on 2011-03-08
9
Medium Priority
?
274 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 1000 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 1000 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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

636 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