Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SP help

Author  Topic 

JeffS23
Posting Yak Master

212 Posts

Posted - 2007-12-28 : 17:44:54
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?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-12-28 : 17:50:38
script all sprocs as alter proc
mass replace the field
run

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-12-29 : 00:57:30
and this may help you to script out the procedures to a text file
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/12/13/script-out-procedures-and-functions-part-2.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -