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)
 how to change field name in SP

Author  Topic 

abhit_kumar
Posting Yak Master

147 Posts

Posted - 2010-02-11 : 00:32:41
hello frnds,

Im going to change on Table field name from APInv to APInvoice.
Now the problem is that i have used field name APInV in lots of stored procedure,
so is there any way so that i dont need to go to individual sp to change the
field name?

Please guide me.

Regards,

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2010-02-11 : 00:35:50
1.Generate Script and do find and replace
2.Drop all the procedures
3.Recreate using the updated script

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-11 : 00:36:48
nope. you need to search within stored proc for references and change it manually. you could use sp_depends to find out sps that refer your table

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

abhit_kumar
Posting Yak Master

147 Posts

Posted - 2010-02-11 : 01:05:57
Thanks visakh,

but is there not any other way excepting to change it manually?

Else your suggestion is good.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-02-11 : 01:44:43
you can also use computed column as suggested over
http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/1adc31e3-06fc-43d3-9246-d842ee8fc98b



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -