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



On Jun 26, 11:08 am, COHENMAR...@xxxxxxxxx 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
.



Relevant Pages

  • Re: Scripting T-SQL CREATE Statements
    ... a backup of user-defined SQL Server objects. ... I am having a hard time finding the T-SQL functions and system stored procedures used to return the scripted ... like when you right-click an object and select Script Object to New Window as>> Create. ... I am trying to get it much like the instnwnd.sql file that comes with the .NET Framework SDK v1.1. ...
    (microsoft.public.sqlserver.programming)
  • Re: Cannot Open SQL Server Table in Access.ADP File.
    ... I dont think that SQL Server will take 'veiw dependencies' into effect; ... Generate Script Wizard did not work on my original database, ... After fixing some of my tables and a few stored procedures and views, ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Unable to view system stored procedures from .NET IDE and unable to debug SQL
    ... But what is the reason for the debug problem I mentioned below? ... try to step into a stored procedure in the Northwind database, ... Run SQL server setup or contact database ... I can't see any system stored procedures in master. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Database Model - Class, objects and interaction
    ... I was just proving stored procedures can call views. ... stuff like security and logging. ... So given 100,000 users, you would create database accounts for each? ... Part of our system's integrity was its reliability, and reliability is often assisted by simplicity. ...
    (comp.object)
  • Re: Identical database w/ identical stored procedures?
    ... > creating the maintence nightmare of updating the same stored procedure ... First of all, put your source code, tables, stored procedures and all ... This can be achieved with a help table in the database. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)