This question is very old and already considered an answer, but just to know that Renaming SP is not a good idea , because it does not update sys.procedures.
For example, create SP "sp_abc",
CREATE PROCEDURE [dbo].[sp_abc] AS BEGIN SET NOCOUNT ON; SELECT ID, Name FROM tbl_Student WHERE IsDeleted = 0 END
Now rename it
sp_rename 'sp_abc', 'sp_Newabc'
The following warning is displayed.
Caution: Changing any part of an object name could break scripts and stored procedures.
Now see sp_Newabc
sp_helptext sp_Newabc
you can see this result.
CREATE PROCEDURE [dbo].[sp_abc] AS BEGIN SET NOCOUNT ON; SELECT ID, Name FROM tbl_Student WHERE IsDeleted = 0 END
It still contains the old sp_abc procedure name. Since when renaming SP it does not update sys.procedure.
Better solution is to drop the stored procedure and re-create it with the new name.
kkk
source share