Querying SYSObjects to rename SP code
Posted on 2006-10-28
I have over 200 stored procedures in my database and about 90 tables. I have renamed some of the schemas and tables, so I have to change code in about 90% or more of the stored procedures. I have done about 20 so far, and I am beat... is it possible to query sysobjects for code, or table references inside of the stored procedures?
for example, if I have a stored procedure with this code (select * from [Inventory].tbl_Inventory) and I change it to (select * from [Inventory].Products) how can I automate this? I want to search all stored procedures with have the tbl_Inventory and replace it with tbl_Products. Is this possible?