SQL Server Management Studio Rename problem for View, SP and UDF - by Vlad Kurshin

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


0
0
Sign in
to vote
ID 333094 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 3/14/2008 2:09:15 PM
Access Restriction Public

Description

Renaming View, SP, or UDF using  SQL Server Management Studio does not change the field “Definition” (the actual field name might be different, we can only see it through the views) in underlining system table.
Sign in to post a comment.
Posted by Microsoft on 3/18/2008 at 8:40 AM
Hi Vlad,
Thanks for your feedback on this. This is by design. Sys.sql_modules stores the actual script specified when creating a module. Renaming a sql module such as a stored procedure will not update the definition in sys.sql_modules.
This is documented in BOL topic sp_rename:
Renaming a stored procedure, function, view, or trigger will not change the name of the corresponding object name in the definition column of the sys.sql_modules catalog view. Therefore, we recommend that sp_rename not be used to rename these object types. Instead, drop and re-create the object with its new name.

Srini Acharya
Relational Engine




Posted by Microsoft on 3/18/2008 at 8:40 AM
Hi Vlad,
Thanks for your feedback on this. This is by design. Sys.sql_modules stores the actual script specified when creating a module. Renaming a sql module such as a stored procedure will not update the definition in sys.sql_modules.
This is documented in BOL topic sp_rename:
Renaming a stored procedure, function, view, or trigger will not change the name of the corresponding object name in the definition column of the sys.sql_modules catalog view. Therefore, we recommend that sp_rename not be used to rename these object types. Instead, drop and re-create the object with its new name.

Srini Acharya
Relational Engine