Is it required to update all procedures when table gets updated?
Hi I'm working开发者_JS百科 with sql server 2008 and I've a table with following columns
eid,empname,sal etc.. and I've 1000 stored procedures based on this table.
Now what I want to do is, I want to rename eid to empid in table. So do I need to update all 1000 stored procedures dependent on this column? Ofcourse yes, is there any shortcut method to do this? instead of open all 1000 procedures and rename it manually?
Thanks in advance
Anything that actually uses or explicitly selects the field you are changing the name of will need to be changed. There is no real shortcut around this. Why is changing the name of the field so important if it is going to cause you this much trouble?
There are tools like SQL Prompt which will auto-generate the changes for you too ("Smart rename")
Otherwise, to avoid changing all procs in one go you could create eid as a computed column but you'd need to change the write procs.
精彩评论