Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SP Help

Status
Not open for further replies.

Tech2377

Programmer
Nov 13, 2007
81
I have a database that I have changed the spelling of a field in all of the tables of a database. I also need to change the field name referenced in all of my stored procedures also. Considering I have about 50 stored procedures to deal with....

Can I somehow check ALL stored procedures in my database for a field name and variable name and change them both?
 
Checking yes, changing no.

You can search the text of your stored procedures using the syscomments table. You however have to script them out and update them manually.

Query the text field of the syscomments table to see which procedures have the text you are looking for.
Code:
select object_name(id)
from syscomments
where text like '%ColumnName%'

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top