Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Find and REMOVE string from stored procedures

By pattikay,

This script extends the "Find strings in text of stored procedures" Script by LiviuB and and now finds the
string and removes it.
You may modify script to just comment out the text.
This script removes the text (in this case 'set dateformat dmy') from all non-system stored procedures in a database.
Modify the variable @searchstring to contain the text you want removed.
It does so by modifying the system table : syscomments.
It then marks the stored procedures for recompilation.

This is an extension of the "Find strings in text of stored procedures" Script by LiviuB found at
http://sqlservercentral.com/scripts/contributions/1240.asp
Therefore I would like to acknowledge the basis.

Note: Ensure the stored procedures are fine after running the script.

Total article views: 246 | Views in the last 30 days: 1
 
Related Articles
FORUM

Stop Customers from Modifying Stored Procedures

I want to stop customers from modifying stored procedures.

FORUM

How to findout who has modified the Stored procedures recently

How to findout who has modified the Stored procedures recently

FORUM

Scripting Stored Procedures

Scripting Stored Procedures

FORUM

How to modify 'system stored procedure' SQL 2008?

SQL Server 2008 modify alter system stored procedure

SCRIPT

Generate Drop / Create Script for views, stored Procedures

This Script generates drop and create scripts for views or stored procedures.

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones