473,383 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 4032
CO*********@lycos.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...@lycos.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
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...
2
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...
3
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
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...
5
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...
7
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...
5
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...
14
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...
1
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.