473,765 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I search for a string in a set of stored procedures?

I found that I'm making an error in my 'case' statements, and now I
want to go through a database full of many stored procedures to find
that error in some of them and to fix it. Is there any way to do a
search through multiple stored procedures at once? I don't see one in
my version of Sql Server Management Studio?
Thanks,
Marv
Jun 27 '08 #1
2 4054
CO*********@lyc os.com wrote:
I found that I'm making an error in my 'case' statements, and now I
want to go through a database full of many stored procedures to find
that error in some of them and to fix it. Is there any way to do a
search through multiple stored procedures at once? I don't see one in
my version of Sql Server Management Studio?
I think this is right (I mostly still work with 2K which uses older
methods):

select o.name
from sys.objects o
join sys.sql_modules m on o.object_id = m.object_id
where m.definition like '%text%'
Jun 27 '08 #2
On Jun 26, 11:08*am, COHENMAR...@lyc os.com wrote:
I found that I'm making an error in my 'case' statements, and now I
want to go through a database full of many stored procedures to find
that error in some of them and to fix it. *Is there any way to do a
search through multiple stored procedures at once? *I don't see one in
my version of Sql Server Management Studio?
Thanks,
Marv
Alternatively stored procedures of the database can be scripted by
right clicking on the database name and selecting Generate Scripts...
under Tasks in SSMS. This creates a .sql file with all the stored
procedures (formatted). Then Find/Replace command can be used to
search / update. Once all changes are made, executing the script can
update all stored procedures (if "Add If Not Exists..." option is not
selected during the Generate Scripts Wizard).

Also "Database Publishing Wizard" can be used (free downloadable from
Microsoft) to script each stored procedure to individual files. Then a
program like SQL Server Business Intelligent Development Studio can be
used to Find/Replace in files. This method can be useful if one also
wants to add the scripts to source control.

James
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3664
by: todd | last post by:
here is a search tool SP I wrote. How many times have you wanted to search all your Stored procs or views (in a database) for a keyword but couldn't!? Well now you can! THis can makes life a lot easier for developers. Would you email me and let me know which part of the world my code is running in?
2
3508
by: M Wells | last post by:
Hi All, I'm wondering if anyone can tell me if it's possible to search for stored procedures by their contents? I tend to leave very descriptive notes in stored procedures and they're beginning to build up in number, so I'm wondering if it's possible to search in Query Analyzer for stored procedures that contain certain words / phrases etc.
3
2345
by: Eugene | last post by:
Hi, Is there any way to find all stored procedures that contain a given field Example: I want to find all stored procedures that work with the field ShipDate in tblOrder table Thanks, Eugene
4
9677
by: Axel | last post by:
Is it possible to write a Stored Procedure that takes a string of search keywords as argument and returns the recordset? At the mo I am passing the WHERE String as argument. I got this technique from an Extreme Ultradev tutorial by Rick Curtis it looked quite ok: http://www.princeton.edu/~rcurtis/ultradev/tutorial12.html I have to admit, one of the main reason for passing the WHERE string is that I do not know how to do the string...
5
3486
by: Tim Marshall | last post by:
I was following the thread "Re: Access Treeview - Is it Safe Yet?" with interest and on reading the post describing Lauren Quantrell's SmartTree, I've run into something I don't understand: Stored Procedures. I thought stored pricedures were an Oracle/MS SQL Server thing and don't know how they work with Access Jet. I've looked at some of the help on stored procedures in A2003, but really don't understand what's going on. Can someone...
7
2205
by: David Lozzi | last post by:
I need to support multiple keyword search, not boolean searchs, just simple searches, i.e. "marhsall ma". How is this done? Do I send the entire search string to the Proc? How do I deal with it there? I'm thinking I need to build the WHERE clause in the code behind and send it to the proc. What do you think? Thanks, David Lozzi
5
8352
by: samoore33 | last post by:
I use the code below to return rows matching the state in the theState variable. I want to know if it is possible to search through the DataRow that I am returning with the search. I understand that that creates a DataRow Array. I searched through group postings and found where Cor had said something about bulding the DataTable back, not sure what that meant of if I could use it with this, but any help would be appreciated. Dim t As...
14
2266
by: Simon Gare | last post by:
Hi, have a search.asp page with results.asp page drawing data from an SQL db, problem is the user has to type the whole field value into the search box to retrieve the value on results.asp, what I need is to type in just a few characters e.g. at the moment to search for all pickups at Heathrow Terminal 1 the user has to type in Heathrow Terminal 1
1
3875
by: rshivaraman | last post by:
Hi All : A couple of tables have been identified to be deleted. My job is to find if it is at all used. On searching the web, i found a proc to search for a string within all databases in a server. using system sproc : sp_msforeachdb it searches for a string in views, sprocs, functions, check constraints, defaults, foreign key,
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.